Code: Select all
__attribute__((aligned)
Code: Select all
__attribute__((aligned(1))
Code: Select all
__attribute__((aligned)
Code: Select all
__attribute__((aligned(1))
So, instead of keeping __attribute__, better use pack pragma which will make the code common with windows.npomarede wrote:The problem is that it's defined as :
typedef struct {
uint8_t sign; // c2eOOB
uint8_t type; // type of OOB following the header
uint16_t size; // size of following data
} __attribute__ ((packed)) __attribute__((aligned)) C2OOBHdr;
and when using gcc, if you don't specify a value for "aligned" then you get a machine dependant default value, which in this case is 16
One possible change could be to use aligned(1), but as gcc now also supports "pragma pack(1)" as windows and clang do, I think the best way would be to remove all those __atribute__ and only keep this :
#pragma pack(push, 1)
<...structs definitions...>
#pragma pack(pop)