Altera_Forum
Honored Contributor
20 years agoAlignment of structures
Hello,
I know that this is very basic question which is not only relating to Nios. In the web and in the documentation of GCC I didn’t find a satisfactory answer. Will a structure like the following always be aligned to the 4 byte boundary or do I have to tell the compiler the behaviour explicitly? The alignment is very important for dealing with the data by pointers. struct TEthernetHeader { u8_t dest[6]; u8_t src[6]; u16_t type; }; Regards, niosIIuser