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.

#pragma STRUCT_ALIGN usage

Hi,

   I want to use STRUCT_ALIGN to align the struct member to byte align , the code like this.

typedef struct packA

{

uint8 a;

uint16 b;

int32 c;

}  testStruct;

#pragma STRUCT_ALIGN(testStruct, 1);

testStruct A;

I hope the result : sizeof(A)=7, but the result sizeof(A)=8.   what's wrong ?   If I misunderstand for  STRUCT_ALIGN?  

 

 

Regards,

Ellen