#include <stdio.h>
int main ()
{
printf ("%d %d\n", sizeof(unsigned long long), alignof(unsigned long long));
return 0;
}
yields the following output
8 4
I.e. alignment of a 64 bit integer is 4 bytes. This freaks out e.g. a Qt5 QtBase test (tst_QGlobal::qAlignOf()) which expects alignment for it to be 8 bytes as well. Same story for double.
I wonder what our GCC should really return in such a case given that 32-bit Linux and Windows compilers return 8 (at least, according to the Qt test case).
Currently, the following test program
yields the following output
I.e. alignment of a 64 bit integer is 4 bytes. This freaks out e.g. a Qt5 QtBase test (
tst_QGlobal::qAlignOf()
) which expects alignment for it to be 8 bytes as well. Same story fordouble
.I wonder what our GCC should really return in such a case given that 32-bit Linux and Windows compilers return 8 (at least, according to the Qt test case).
Found when doing bitwiseworks/qt5-os2#16.