[Lsb-infrastructure] definition of NULL

Denis Silakov silakov at ispras.ru
Tue Sep 9 06:34:06 PDT 2008


Wichmann, Mats D wrote:
> Seems like the definition of NULL in LSB could
> be improved.
>
> There's already a comment in LSB's stddef.h that
> "(void *) would be better, but causes problems with C++".
> We now have a mechanism for that which didn't exist
> at the time.
>
> The upstream definition looks like:
>
> #ifndef __cplusplus
> #define NULL ((void *)0)
> #else  /* C++ */
> #define NULL 0
> #endif
>
> Further, there's also a protection mechanism, glibc
> headers while are likely to need it define __need_NULL
> and leave it to gcc's stddef.h so it's not defined
> multiple times. I'm seeing lots of messages about NULL
> in the xts5 build log (which is admittedly a *bit* of
> a special case) so we might want to at least protect
> it with #ifndef NULL like we do for TRUE and FALSE.

Yes, this would be nice; pushed the update to bug 2296.

-- 
Regards,
Denis.



More information about the lsb-infrastructure mailing list