Memory alignment at byte.

Hi everybody,

I need to set the alignment at 1 byte for a particular struct declaration, so I’ve found the following #pragma in the ncc_post.c file (automatically included in my project):

#pragma alignvar (32)

so I thought to modify and use it writing the following piece of code:

#pragma alignvar (8)
struct struct_type a;
#pragma alignvar (32)

Unfortunately the compiler logs in the problem window (DIGI ESP for NET+OS v7.4 IDE) that “the directive has been egnored”…

Do you know if there is a way to obtain the desired 1-byte alignment?

Thank you very much,

Maurizio Malaspina


#pragma pack(1)

#pragma pack() // back to default