Hi,
I am migrating my project from Compiler 5 to Compiler 6.
While doing this, I found out that in stm32f4xx_hal_def.h, the Macro re-definition of __pakced does not actually comply with armclang. Following is the snippet from the header file:
* ARM Compiler 4/5 */ #if defined ( __CC_ARM ) /* already defined by compiler */ /* * ARM Compiler 6 (armclang) */ #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) #ifndef __weak #define __weak __attribute__((weak)) #endif /* __weak */ #ifndef __packed #define __packed __attribute__((__packed__)) #endif /* __packed */
Shouldn't __attribute__((packed)) be used instead of __attribute__((__packed__))?
or, more properly, reference to the definition in cmsis_armclang.h:
#define __PACKED __attribute__((packed, aligned(1)))
Or am I missing something?
Thanks in advanced
Hi Tang,
That snippet was taken from DFP 2.13 line 135 to line 149
I am not sure what is the pre-processed value of __ARMCC_VERSION, but the comment says it is for ARM Compiler 6.
Thanks
As written here developer.arm.com/.../function-attributes
The keyword format is either of the following: __attribute__((attribute1, attribute2, ...)) __attribute__((__attribute1__, __attribute2__, ...))