This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Warning for unadorned 0 in varargs lists?
- From: "Dave Korn" <dk at artimi dot com>
- To: "'Kaveh R. Ghazi'" <ghazi at caip dot rutgers dot edu>,<hueffner at informatik dot uni-tuebingen dot de>
- Cc: <espie at quatramaran dot ens dot fr>,<gcc at gcc dot gnu dot org>,<jsm at polyomino dot org dot uk>,<segher at kernel dot crashing dot org>
- Date: Mon, 23 Aug 2004 17:19:19 +0100
- Subject: RE: Warning for unadorned 0 in varargs lists?
> -----Original Message-----
> From: gcc-owner On Behalf Of Kaveh R. Ghazi
> Sent: 23 August 2004 17:09
> To: hueffner
> Cc: espie; gcc; jsm; segher
> Subject: Re: Warning for unadorned 0 in varargs lists?
>
> > My concern was about differentiating between 0 and NULL.
> If you care
> > about what works in practise, you should warn about neither; if you
> > care about pedantic standard compliance, you should warn for both.
> > Falk
>
> I used to feel as you do, that since 0 works in practice we should
> silently accept it. But it costs the user nothing to switch to NULL
> in their code and may in fact fix a bug where some 64-bit ABI doesn't
> do padding for unadorned 0.
>
> Forcing the user to write NULL instead of 0 even if in practice 0 may
> be okay is just like e.g. requiring double parens around assignments
> used as truth values.
But the C language spec says that an integer constant zero must compare
equal to a null pointer.
So why aren't we saying that the 64-bit ABIs are non-conformant?
cheers,
DaveK
--
Can't think of a witty .sigline today....