This is the mail archive of the
mailing list for the GCC project.
Re: C++ PATCH to cp/decl.c: Timing name lookup
On Thu, 13 Feb 2003 12:24:06 -0500 (EST), "Kaveh R. Ghazi" <firstname.lastname@example.org> wrote:
> > Zack Weinberg <email@example.com> writes:
> > | Andrew Pinski <firstname.lastname@example.org> 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.