I discovered the problem when I was trying to access the flags member from the latter structure. I was always getting a wrong value, obviously because of the wrong size of UBXHeaderStruct.
Does anyone know what could be wrong? Any suggestions are welcome.
Nothing wrong, it’s called padding. If you want to change the alignment settings use the “attribute(())” directive in GCC.
Here is my solution to define a structure packed (aligned to 1 byte boundary) in Visual C and in GCC compiler at the same time. Maybe it is not the nicest method, but i didn’t find a better solution so if somebody has a more elegant way don’t hide it.