From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: GCC 2.8.1 and NULL Date: Sun, 28 Jun 1998 13:07:46 -0400 Organization: Two pounds of chaos and a pinch of salt. Lines: 28 Message-ID: <35967862.BCEA0A4D@cs.com> References: NNTP-Posting-Host: ppp127.cs.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Gili wrote: > > Since GCC 2.8.1 (and perhaps a bit earlier) the authors have begun > using "#define NULL __null".. One problem arises: > > If #include occures anywhere throughout my code (and since > it is a very common library, it obviously does) I get the following > message telling me that stdio.h tried to redefine NULL (which was > previously defined as __null).. The only way I found around this is to > stick an "#ifndef ... #endif" block before "#define NULL 0" command in > .. But what I'm wondering is, is this conflict suppose to > exist? Is something wrong with my configuration? What's going on? :) You may want to try always putting #include as the first include statement in your source files. This allows the C++ libraries to undefine or redefine NULL as they see fit. This issue was discussed recently; you may be interested in looking it up in the mail archives (http://www.delorie.com/djgpp/mail-archives/). I don't recall exactly what solution we arrived at. -- --------------------------------------------------------------------- | John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com | | Proud owner of what might one | http://www.cs.com/fighteer/ | | day be a spectacular MUD... | ICQ UIN#: 7406319 | | Plan: To make Bill Gates suffer | HEAT User ID: Fighteer | ---------------------------------------------------------------------