AnsweredAssumed Answered

Data Align Packed Struct

Question asked by Joshua on Apr 10, 2014
Latest reply on Apr 10, 2014 by sung.chen_chung
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:

    #pragma data_alignment = 4
    typedef __packed struct
    {
        u8 data[1024];
    } BLOCK8_STRUCT;

Can anyone see anything wrong with what I'm trying to do?

Thanks

Outcomes