http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47175
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-05 15:17:50 UTC --- (In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > (In reply to comment #1) > > > > Checking __amd64, __amd64__, __x86_64 __x86_64__ for > > > > pointer size is wrong since pointer size may be > > > > 32bit on x86-64. > > > No, it can't be. The macros are set in dependence of the target platform > > > (m32 > > > or m64). That means, if m32 is given the macro __i686 is set instead of > > > __amd64. On the other hand, if m64 is given the macro __amd64 is set. I > > > don't > > > want to know the really underlying platform. I (or Matlab) want to know > > > the > > > target platform. So it is right to check the __amd64 macro. You can try > > > it with > > > the gcc-4.4. Only with gfortran-4.4 the macro is missed. > > > > See > > > > http://www.kernel.org/pub/linux/devel/binutils/ilp32/abi.pdf > > > > where pointer size is 32bit. > > As far as I understood means ILP32 a 32bit application in a 64bit environment No. ILP32 is a 32bit environment with 64bit instruction sets. > and LP64 a 64bit application in 64bit environment. Am I Right? The predefined > preprocessor macro __amd64 is true if I compile with -m64 (default on Linux) > and it is not true if I compile with -m32. So why I can't check against this > macro, as far it is supported (as in gcc)? Please correct me if I'm totally > wrong. Or do you want to tell me that a 64bit application could use 32bit > pointers, or the other way round? If so, how is it possible? ILP32 will define both __amd64 and __ILP32__. __amd64 is ISA, which can have 32bit or 64bit pointer sizes.