Date: Wed, 8 Mar 2000 15:22:15 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Hans-Bernhard Broeker cc: djgpp-workers AT delorie DOT com Subject: Re: iso646.h and some questions In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 8 Mar 2000, Hans-Bernhard Broeker wrote: > On Wed, 8 Mar 2000, Eli Zaretskii wrote: > > > On Wed, 8 Mar 2000, Hans-Bernhard Broeker wrote: > > > > > > > #undef NULL > > > > > #define NULL 0 > > > > > > > > Won't this make trouble in C++ programs? > > > > > > Why should it? This is the exact definition found in current DJGPP > > > headers, already. > > > > See stdlib.h. Recent versions of libstdc++ define NULL to something like > > __null. There was a thread about this on djgpp-workers several months > > ago, and I think on c.o.m.d. as well; you might read it for details. > > > > I guess we fixed stdlib, but not stddef... > > When would that have been done? I just downloaded a spare copy of > djdev203.zip, dated Jan 07, 2000, to this Linux box, and this is what I > got: > > ~/Ltmp/djgpp> find include -type f | xargs grep 'define.*NULL' Wrong command. It misses these two lines from stdlib.h: /* Some programs think they know better... */ #undef NULL This is in stdlib.h because the original version caused compiler warning/errors (I forget which) when compiling C++ programs. The reason turned to be that the C++ compiler has its own definition of NULL, pulled from some C++ header. > As you can see, it's '0', everywhere in the C headers. Yes, because it's good enough for C. But I was talking about including these headers in C++ programs.