This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Predefined macro incompatibility (gcc vs egcs)



On Linux there is an incompatibility in the pre-defined macros between
egcs-1.0.1 and gcc 2.7.0 (at least). I did a default --with-shared
egcs installation.

jcownie@pc: gcc -v -dM -E /tmp/null.c
Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.0/specs
gcc version 2.7.0
 /usr/lib/gcc-lib/i486-linux/2.7.0/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=7 -D__ELF__ -Dunix -Di386 -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386) -dM -D__i486__ /tmp/null.c
GNU CPP version 2.7.0 (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/i486-linux/include
 /usr/lib/gcc-lib/i486-linux/2.7.0/include
 /usr/include
End of search list.
#define __linux__ 1 
#define linux 1 
#define __i386__ 1 
#define __i386 1 
#define __GNUC_MINOR__ 7 
#define __i486__ 1 
#define i386 1 
#define __unix 1 
#define __unix__ 1 
#define __GNUC__ 2 
#define __linux 1 
#define __ELF__ 1 
#define unix 1 
jcownie@pc

jcownie@pc: gcc -v -dM -E /tmp/null.c
Reading specs from /usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.23/specs
gcc version egcs-2.90.23 980102 (egcs-1.0.1 release)
 /usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.23/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=90 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -dM -Di386 -Di586 -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -D__i586__ -Asystem(unix) -Acpu(i386) -Amachine(i386) /tmp/null.c
GNU CPP version egcs-2.90.23 980102 (egcs-1.0.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/egcs/i586-pc-linux-gnulibc1/include
 /usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.23/include
 /usr/include
End of search list.
#define __linux__ 1 
#define linux 1 
#define __i386__ 1 
#define __GNUC_MINOR__ 90 
#define __i586__ 1 
#define i386 1 
#define i586 1 
#define __unix 1 
#define __unix__ 1 
#define __GNUC__ 2 
#define __linux 1 
#define __ELF__ 1 
#define unix 1 
jcownie@pc: 

Note, in particular, that "__i386" is defined by gcc, but not by egcs.

-- Jim 

James Cownie			<jcownie@dolphinics.com>
Dolphin Interconnect Solutions  +44 117 9071438
http://www.dolphinics.com/toolworks




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]