This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sizeof() reporting wrong size of struct

Using ARM and RTX on MCB2300, I have the following struct defined from an extern file storage array:

typedef struct choreoEvent
{ U8 flags; U16 leftover; U8 disable; U16 cueid; U32 time; char name[6]; U32 circuit; char display[12];
} choreoEvent_t;

This is 32 bytes in storage, but sizeof is reporting it as 36 bytes, and trying to access name starts 2 bytes off.

Is it doing alignment on the U8's or something? I can't restructure it because it's being read form an external file stream. Anyone see what's happening?

0