This is the mail archive of the gcc-patches@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: C++ PATCH to cp/decl.c: Timing name lookup


On Thu, 13 Feb 2003 12:24:06 -0500 (EST), "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> wrote:

>  > Zack Weinberg <zack@codesourcery.com> writes:
>  > 
>  > | Andrew Pinski <pinskia@physics.uc.edu> writes:
>  > | 
>  > | >	* decl.c: (define_label): Fix warning for return 0 instead of NULL.
>  > | 
>  > | NULL might be a bare 0 in C (allowed, but not required) so better you
>  > | should write (void *)0 explicitly.
>  > 
>  > Yeah, you're correct.  I believe I'll just go with a NULL_TREE.
>  > -- Gaby
>
> Hmm, none of this should be necessary.  GCC avoids warnings about
> ptr/int assignment or conversion when the int is zero, even if the
> zero is bare.

Yes.  "0" is a valid null pointer constant.

> Ok the problem was that the zero was embedded in a comma list.  E.g.:
>[...]
> Perhaps this is a case where we can improve GCC's detection and avoid
> the spurious warning.

It's not spurious.  (0,0) is not a valid null pointer constant; an integral
constant-expression may not contain a comma operator.

Jason


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