This is the mail archive of the gcc@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]

buglet in -dM



I discovered this oddity recently with egcs-1.0.2: -dM does not, in fact,
dump *all* the defines that are in effect at the end of preprocessing.

In particular, __STDC__ is missing.  I haven't investigated if there
are other defines missing.

For concreteness, an explicit example is attached.

---------------------------------------------------------------------------
Tim Hollebeek                           | "Everything above is a true
email: tim@wfn-shop.princeton.edu       |  statement, for sufficiently
URL: http://wfn-shop.princeton.edu/~tim |  false values of true."

---
wagner:~:101> cat foo.c

int main() {
#ifdef __STDC__
    puts("yes");
#else
    puts("no");
#endif
    return 0;
}
wagner:~:102> gcc -v foo.c
Reading specs from /usr/local/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)
 /usr/local/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.90.27/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=90 -Dunix -Dmips -Dsgi -Dhost_mips -DMIPSEB -D_MIPSEB -DSYSTYPE_SVR4 -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ -D_MIPS_SIM=_MIPS_SIM_ABI32 -D_MIPS_SZPTR=32 -D__unix__ -D__mips__ -D__sgi__ -D__host_mips__ -D__MIPSEB__ -D_MIPSEB -D__SYSTYPE_SVR4__ -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ -D_MIPS_SIM=_MIPS_SIM_ABI32 -D_MIPS_SZPTR=32 -D__unix -D__mips -D__sgi -D__host_mips -D__MIPSEB -D__SYSTYPE_SVR4 -Asystem(unix) -Asystem(svr4) -Acpu(mips) -Amachine(sgi) -D__CHAR_UNSIGNED__ -D__LANGUAGE_C -D_LANGUAGE_C -DLANGUAGE_C -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -D__EXTENSIONS__ -D_SGI_SOURCE -D_LONGLONG -D_MIPS_FPSET=16 -D_MIPS_ISA=_MIPS_ISA_MIPS1 -D_MIPS_SZINT=32 -D_MIPS_SZLONG=32 foo.c /var/tmp/cca002jW.i
GNU CPP version egcs-2.90.27 980315 (egcs-1.0.2 release) [AL 1.1, MM 40] SGI running IRIX 5.x
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/mips-sgi-irix5.3/include
 /usr/local/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.90.27/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.90.27/cc1 /var/tmp/cca002jW.i -quiet -dumpbase foo.c -version -o /var/tmp/cca002jW.s
GNU C version egcs-2.90.27 980315 (egcs-1.0.2 release) (mips-sgi-irix5.3) compiled by GNU C version egcs-2.90.27 980315 (egcs-1.0.2 release).
 /usr/local/mips-sgi-irix5.3/bin/as -v -o /var/tmp/cca002jW1.o /var/tmp/cca002jW.s
GNU assembler version 2.5.2 (mips-sgi-irix5.3), using BFD version 2.5
 /usr/local/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.90.27/ld -call_shared -no_unresolved -_SYSTYPE_SVR4 /usr/lib/crt1.o -L/usr/local/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.90.27 -L/usr/local/mips-sgi-irix5.3/lib -L/usr/local/lib /var/tmp/cca002jW1.o -lgcc -lc -lgcc /usr/lib/crtn.o
wagner:~:103> ./a.out
yes
wagner:~:104> gcc -E foo.c | grep puts
    puts("yes");
wagner:~:105> gcc -E -dM foo.c | grep STDC
wagner:~:106> 


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