Originally posted by: TRB
I agree with shyhc, the reason has to do with allignment.
However, assuming you are using the AIX compiler, and further
assuming you NEED to sizeof to return 1, you can use the "-qalign=packed"
argument to the compiler which will change the alignment rules for
the whole program, or you can use a "pragma" to change the alignment
rules for a single structure.
Example of pragma:
#pragma options align=packed
struct Foo
{
unsigned char m1;
};
#pragma options align=reset
HTH,
-tony
#AIX-Forum