Re: gcc __alignof__() surprise

2014-05-06 Thread Andy Dougherty
On Sun, May 04, 2014 at 11:26:22AM +0100, Nicholas Clark wrote: > Just for the record: > > $ cat sizer.c > #include > int main() { > printf(" sizeof(long long) = %2u > __alignof__(long long) = %2u\n", (unsigned) sizeof(long long), (unsigned) > __alignof__(long

Re: gcc __alignof__() surprise

2014-05-05 Thread yary
You ought to be able to test that with something like: struct {long long N} a; char b; struct {long long N} c; int d; d=&c - &a; /* I can't remember if you need to cast c & a as char to get byte distance */ printf("a is at %d, c is at %d, they are %d apart\n",&a,&c, d); -y On Sun, May 4, 2014