Mail Archives: djgpp/1998/08/22/19:06:47
Ted Larsson wrote:
> Programs seem to compile & link all right, but I have noticed a few
> minor things:
>
> * The compiler no longer recognizes the word NULL; gives an error
> message. Why?
This is a known problem. G++ 2.8 invented a special keyword `__null'
for null pointers, in order to solve some type-checking problems. Their
headers #define NULL __null, or something similar. But DJGPP's headers
unconditionally #define NULL 0 or similar, and so there is a conflict.
There is a philosophical dispute ongoing over this. DJ feels that G++'s
behavior is wrong, and doesn't want to change DJGPP to work around.
Others feel differently.
I believe you can include C headers before C++ to avoid this.
Alternatively, you can wrap each definition of NULL in the DJGPP headers
with #ifndef NULL/#endif.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -