bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 0 vs. NULL


From: Paul Eggert
Subject: Re: 0 vs. NULL
Date: Mon, 15 Oct 2007 14:30:27 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Compilers such as Sun C++ really define NULL to 0
> (in both C and C++ mode!), and misinterpret NULL in varargs and sizeof.

The problem with varargs is one that has bitten me personally.  Ouch!

But "sizeof (NULL)" is a new one on me.  As near as I can make out,
that expression can yield any nonnegative value, as far as the C
standard is concerned.  I'd be mildly surprised to find any useful,
portable code that contains "sizeof (NULL)"; normally I would think
"bug" if I saw such an expression.

This is a trivial point by itself, but I'm raising it since I'm a bit
worried that I am missing something nontrivial here.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]