I'm quite puzzled by the following code:
typedef struct
{
Uint16 first:8; // has a size of 8 bit
Uint16 second:8; // has a size of 8 bit
Uint16 third; // has a size of 32 bit; what's wrong here?
} TSomeStruct;
I expected "third" to have a size of 16 bit instead of 32 bit. I'm sure the mistake must be on my part.
Background: It's not my code base and I'm performing verification on it. Since it's written for an embedded system and a proprietary compiler which I don't have I'm just generating the syntax tree with the "-fdump-translation-unit" option and perform my verification on that. But Uint16 should be 16 bits long in GCC as well so that shouldn't be the problem, right?