We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
You can check the page 4 of http://www.keil.com/appnotes/files/apnt_298.pdf More detailed migration guide can be found here developer.arm.com/.../migrating-from-arm-compiler-5-to-arm-compiler-6
Thanks. That is basically what "camis_armclang.h" is doing...my point was actually why the DFP pack is doing something not compatible to the armclang standard?
Which STM32F4 DFP version are you using? Since v2.12 this DFP pack is compatible with armclang. The latest DFP is v2.13
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__, ...))