adtools / amigaos-cross-toolchain

AmigaOS cross compiler for Linux / MacOSX / Windows
184 stars 48 forks source link

Guarantee 64-bit types #19

Closed Leffmann closed 8 years ago

Leffmann commented 8 years ago
machines/m68k/machine.c: In function 'gen_dc':
machines/m68k/machine.c:3503:7: warning: right shift count >= width of type
       vumax=zumand(zumrshift(vumax,ul2zum(32UL)),ul2zum(0xffffffff));
       ^

With -std=c9x/gnu9x/c99 -m32, long will be a 32-bit type. Specify long long to guarantee 64-bit size and get rid of warnings like the above, and possible errors in the generated code.

cahirwpz commented 8 years ago

How long long is going to be interpreted if we compile the code on 32-bit architecture (without -m32 switch)?

Leffmann commented 8 years ago

It should be decided by the language standard. C99 specifies long long to be at least 64-bit, and judging by VBCC's makefile, it requires C99, C9x or GNU9x to build.