bitwiseworks / gcc-os2

Port of GCC compiler to OS/2
GNU General Public License v2.0
16 stars 2 forks source link

Sort out alignof for 64 bit types #33

Open dmik opened 3 years ago

dmik commented 3 years ago

Currently, the following test program

#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).

Found when doing bitwiseworks/qt5-os2#16.