* [RFC/AIX] xm-aix4.h - Can we remove NULL re-define?
@ 2004-08-08 4:52 Joel Brobecker
2004-08-08 14:00 ` Andrew Cagney
0 siblings, 1 reply; 2+ messages in thread
From: Joel Brobecker @ 2004-08-08 4:52 UTC (permalink / raw)
To: gdb-patches; +Cc: Andrew Cagney, Peter Schauer, Kevin Buettner
config/xm-aix4.h contains the following definition:
| /* Brain death inherited from PC's pervades. */
| #undef NULL
| #define NULL 0
Is this still needed? Where does this come from?
It looks pretty scary that a compiler would actually defined NULL
as being non-zero. I have always heard that NULL is not garantied
to be zero, but I've seen so much code kind of confusing NULL and
zero that I thought nobody in their right mind would actually do
otherwise...
If still necessary, can this be replaced by something like this in
defs.h?
#if (NULL != 0)
#undef NULL
#define NULL 0
#endif
--
Joel
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [RFC/AIX] xm-aix4.h - Can we remove NULL re-define?
2004-08-08 4:52 [RFC/AIX] xm-aix4.h - Can we remove NULL re-define? Joel Brobecker
@ 2004-08-08 14:00 ` Andrew Cagney
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2004-08-08 14:00 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches, Andrew Cagney, Peter Schauer, Kevin Buettner
> config/xm-aix4.h contains the following definition:
>
> | /* Brain death inherited from PC's pervades. */
> | #undef NULL
> | #define NULL 0
I'd assume that the PC perversity was along the lines of either:
-- NULL not defined
-- #define NULL ((void *)0)
where PC is AIX running on an i386 (yea, right :-).
> Is this still needed? Where does this come from?
>
> It looks pretty scary that a compiler would actually defined NULL
> as being non-zero. I have always heard that NULL is not garantied
> to be zero, but I've seen so much code kind of confusing NULL and
> zero that I thought nobody in their right mind would actually do
> otherwise...
>
> If still necessary, can this be replaced by something like this in
> defs.h?
>
> #if (NULL != 0)
> #undef NULL
> #define NULL 0
> #endif
So just delete it.
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-08-08 14:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-08 4:52 [RFC/AIX] xm-aix4.h - Can we remove NULL re-define? Joel Brobecker
2004-08-08 14:00 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox