2014-04-10 05:18 AM
I need to be sure that a struct I use has 32-bit alignment. My IDE (IAR) gives a preprocessor directive for this, which I am trying to use. However, the compiler keeps giving me warnings saying that I can't use this pragma here. Here is how I have used it within my header file where the struct is declared:
&sharppragma data_alignment = 4 typedef __packed struct { u8 data[1024]; } BLOCK8_STRUCT; Can anyone see anything wrong with what I'm trying to do? Thanks #stm322014-04-10 06:15 AM
Hi
Looks to me like the code is trying do the pragma on a definition if the struct rather than on an instance of a struct.