linux libio status
Joe Buck
jbuck@synopsys.com
Thu Oct 16 12:58:00 GMT 1997
> I'm not aware of any problems with __null. If anyone has any overloading
> bugs involving __null, please send them in.
__null isn't a problem, though I don't know what it helps, because it is
g++-specific. Since much of the code I write has to go through about four
different C++ compilers, only one of which is g++, it's not something I
could make use of. Since I never use NULL in my code, I don't care how
you define it -- *unless* you use NULL in the standard headers in a way
that breaks if some user defines NULL the wrong way.
> I believe that NULL should be retrieved from stddef.h, as I outlined
> earlier. This will get the __null definition, which should work for
> everyone. Does anyone have any practical problems with this?
We can't guarantee that some other header will not attempt to define NULL.
On Red Hat Linux 4.2 (with libc 5.3.12+patches), several do; worse, they
define it as (void *)0. True, they do '#ifndef NULL' -- but you have to
make sure the headers appear in the right order.
This all started when we tried to solve the problem of running on current
Linux systems. Current Linux systems define NULL as (void*)0 . The only
safe solution is to remove all use of NULL from all the libstdc++ headers.
User code can safely use NULL if they get your stddef.h definition.
More information about the Gcc
mailing list