This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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....


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]