
10 Nov
2008
10 Nov
'08
5:06 p.m.
Giovanni Piero Deretta wrote:
I'm becoming convinced that we just shouldn't us the __alignof__() builtin from gcc because it lies.
I wouldn't say it likes; from gcc __alignof__ docs:
" Some machines never actually require alignment; they allow reference to any data type even at an odd address. For these machines, `__alignof__' reports the _recommended_ alignment of a type."
x86 is one of those machines (no alignment ever required except for some XMM instructions). The recommended alignment for double is 8 bytes, even if the ABI, for historical reason only requires 4.
I say it lies because the result is useless for structure alignment calculations. -- Jon Biggar jon@biggar.org jon@floorboard.com