Path: utzoo!utgpu!watmath!uunet!cs.utexas.edu!usc!hacgate!ashtate!psivax!csun!mx!cbcscmrs From: mx!cbcscmrs@csun.edu Newsgroups: gnu.g++.bug Subject: Re: Pre-defined NULL Message-ID: <2269@csun.edu> Date: 16 Aug 89 20:37:05 GMT References: <8908122236.AA02560@curly> Sender: news@csun.edu Reply-To: cbcscmrs@ma.csun.edu (Mike Stump) Distribution: gnu Organization: CSU, Northridge School of Engineering & Computer Science Lines: 37 In article <8908122236.AA02560@curly>writes: >Turns out that NULL is always defined in g++ and gcc... A -E compile >shows that NULL is nowhere defined by #define, so it must be preloaded >in the symbol table. >The Ansi standard (4.1.5, 4.10) says that NULL is defined in the respective >library; it is not a reserved or predeclared word. Ivan, what version are you using... To the best of my knowledge gcc has NEVER done this... The below reflects what I have always seen in ANY C compiler I have ever had the pleasure of working with. Try it on your compiler... I suspect the same results. I would hazard a guess that your understanding of -E is flawed. Try grep NULL /usr/include/* and see if any of the file names appear in the list you get when you g++ -E file.cc | grep '^#'. Script started on Wed Aug 16 13:08:20 1989 $ cat /tmp/t.cc main(void) { int i = NULL; } $ g++ -E /tmp/t.cc # 1 "/tmp/t.cc" main(void) { int i = NULL; } $ g++ /tmp/t.cc -o /tmp/t In function int main (): /tmp/t.cc:2: `NULL' was not declared (first use this function) /tmp/t.cc:2: (Each undeclared identifier is reported only once /tmp/t.cc:2: for each function it appears in.) $ exit script done on Wed Aug 16 13:09:00 1989