Mail Archives: djgpp/1998/06/28/23:45:26
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 <stdio.h> 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
> <stdio.h>.. 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 <stdio.h> 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 |
---------------------------------------------------------------------
- Raw text -