🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50112

is this a feature or a bug --- macros ?

#50112
From: Ram Bhamidipaty
Date: Sun, 14 Nov 1993 04:11
57 lines
2172 bytes
I've noticed that gcc (2.4.5) does not print _all_ the macros that are
defined with the -dM option.  For example __STDC__ is defined but not
printed.

I tracked this down to the code in initialize_builtins(), which
installs many macro definitions with types=T_TIME,T_DATE,T_CONST, etc.
dump_all_macros() on the other hand only prints out macro
definitions whose type==T_MACRO.

So does anyone know why this behavior was chosen? Was there some
compelling reason or was it just a mistake?  It seems to me that the
-dM option should print _all_ macro definitions, and not skip some as
it done now.
-Ram

janis:ram {20} cat foo.c

#ifdef __STDC__
#define __stdc_caused_this 1
#endif

#ifdef ____NetBSD____
#define ____netbsd_caused_this 1
#endif

main(){
int j;
j=0;
if( ____netbsd_caused_this)
  j=1;
if( __stdc_caused_this)
  j++;
printf("%d\n",j);
}
janis:ram {29} gcc -E -dM foo.c
#define ____NetBSD____ 1 
#define __i386__ 1 
#define __NetBSD__ 1 
#define __i386 1 
#define __386BSD__ 1 
#define ____386BSD____ 1 
#define __BSD_NET2 1 
#define __stdc_caused_this 1 
#define i386 1 
#define BSD_NET2 1 
#define __unix 1 
#define __BSD_NET2__ 1 
#define __unix__ 1 
#define __GNUC__ 2 
#define ____netbsd_caused_this 1 
#define unix 1 
--
--------------
Ram Bhamidipaty                     use this ->ram@epidat.epi.wisc.edu
Department of Preventive Medicine   or this->ram%epidat.decnet@macc.wisc.edu
University of Wisconsin, Madison    or this->ram@xor.epi.wisc.edu
Technical Details
Message-ID: <RAM.93Nov13221115@xor.epi.wisc.edu>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!saimiri.primate.wisc.edu!news.doit.wisc.edu!psl.wisc.edu!128.104.200.15!ram

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,4094afa6ad98ba47,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-11-13 23:31:43 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!saimiri.primate.wisc.edu!news.doit.wisc.edu!psl.wisc.edu!128.104.200.15!ram
From: ram@xor.epi.wisc.edu (Ram Bhamidipaty)
Subject: is this a feature or a bug --- macros ?
Message-ID: <RAM.93Nov13221115@xor.epi.wisc.edu>
Sender: news@pslu1.psl.wisc.edu (USENET News System)
Organization: Physical Sciences Lab, UW-Madison
Date: 14 Nov 1993 04:11:14 GMT
Lines: 57