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.

MSP430 how to code #pragma pack(push,1) and #pragma pack(pop) structure alignement with Code composer studio Version: 4.2.3.00004

Hello,

i can't compile the code for data alignement

: struct __attribute__((__packed__)) packed_struct { char c1; int i; char c2; };

it gives the errors :

line 126: error: expected a ";"
line 126: error: variable "__packed__" was declared with a never-completed type

i use Code composer studio Version: 4.2.3.00004 for CCS I tried the pragma DATA_ALIGN that seems to be allowed but can't find the way to write it (to be the same as #pragma pack(push,1) statement) I put #pragma DATA_ALIGN ("my_section" 1 ); but get an error and don't know how to define "my_section" I also don't know how to end such a section (equivalent to #pragma pack(pop))

Does anyone knows how to pack structure ?

Thanks for any help

**Attention** This is a public forum