This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH to cp/decl.c: Timing name lookup
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Jason Merrill <jason at redhat dot com>
- Cc: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, <gdr at integrable-solutions dot net>, <gcc-patches at gcc dot gnu dot org>, <pinskia at physics dot uc dot edu>, <zack at codesourcery dot com>
- Date: Fri, 14 Feb 2003 11:08:12 +0000 (GMT)
- Subject: Re: C++ PATCH to cp/decl.c: Timing name lookup
On Fri, 14 Feb 2003, Jason Merrill wrote:
> On Thu, 13 Feb 2003 23:26:49 +0000 (GMT), "Joseph S. Myers" <jsm28@cam.ac.uk> wrote:
>
> > On Thu, 13 Feb 2003, Jason Merrill wrote:
> >
> >> It's not spurious. (0,0) is not a valid null pointer constant; an integral
> >> constant-expression may not contain a comma operator.
> >
> > And we ought to get rid of GCC's C extensions that allow such things
> > without -pedantic.
>
> Huh? The warning was just about a conversion from integer to pointer. No
> extensions involved.
The message <http://gcc.gnu.org/ml/gcc-patches/2003-02/msg01067.html>
mentioned -pedantic being needed to generate the warning. The
(undocumented, bogus) extension involved is that GCC counts (0,0) as an
integer constant expression (in C) unless -pedantic is used, which means
it is counted as a null pointer constant unless -pedantic is used, which
means it is silently converted to pointer type unless -pedantic is used.
The warning instead ought to be unconditional.
--
Joseph S. Myers
jsm28@cam.ac.uk