I want to read 3rd party genaterated binary data e.g.
struct t_simple_str
{
char c;
double d;
};
where d has an offset of 8 byte.
Using SunStudio's 12U1 cc 32-bit compiler on Linux the default offset of d is 4 but with
struct t_simple_str
{
char c;
double d __attribute__((aligned(8)));
};
I can achieve that th double is recognized at the correct offset.
Since I have to use the C++ compiler that doesn't support __attribute__((aligned(8)))
I want to know if there is a equivalent feature that calculates the correct offset.
I did some unsuccessful tests with #pragma align 8 (...)
but according documentation it doesn't work on local variables.
Can anybody give me a hint?