This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IAR 中使用#pragma DATA_ALIGN(symbol,constant)时编译器提示不认识#pragma

大虾们:

      IAR 中使用#pragma DATA_ALIGN(symbol,constant)时编译器提示不认识#pragma(unrecognized #pragma ),请问是IAR种不能用这个指令吗?

如果IAR预编译没有这个指令,有其他字节对齐的方式吗?

谢谢!

  •  有没有大咖知道啊?

  • 图1 

    图2

    图3

    1. IAR有相应的字节对齐命令,为 #pragma pack()命令,如图1中所示。

    2. 例如 :

                 #pragma pack(2)

                 typedef  struct

                #pragma pack()

    上例就是将所定义的结构体按2字节对齐,具体见图2。

    3. 关于具体的MSP430系列MCU的字节对齐要求见图3。

    4. 所列图片来源于IAR官方文档《 C/C++ Compiler User Guide for the Texas Instruments MSP430 Microcontroller Family》.

  • 如果您认为此问题已被解答,请在“这是否解答您的问题” 后,点击“”按钮。 感谢您对TI的大力支持!