This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

STM32F4 DFP ARM Compiler 6 __packed Macro Replacement

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

0