This is the mail archive of the
mailing list for the GCC project.
Re: Is this a compiler bug?
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, Steve Kargl <sgk at troutmask dot apl dot washington dot edu>, GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Mon, 22 Sep 2014 12:38:42 -0400
- Subject: Re: Is this a compiler bug?
- Authentication-results: sourceware.org; auth=none
- References: <20140922012346 dot GA4376 at troutmask dot apl dot washington dot edu> <CA+=Sn1nT8by8dUHugr_Ye8TYmSbGS6Axbbmau7d+-d7WCUVPfQ at mail dot gmail dot com> <20140922015627 dot GA4508 at troutmask dot apl dot washington dot edu> <CA+=Sn1=d1uHGWoV=0=vUgjR4f6cJw81JKYOGTYDPOAqwC4VnrA at mail dot gmail dot com> <20140922030836 dot GB4708 at troutmask dot apl dot washington dot edu> <CA+=Sn1=djpGLqFCkptdkwjTWoffvgMseFf7MnzHBrxSQB0rmnA at mail dot gmail dot com> <1411395779 dot 16438 dot 12 dot camel at surprise> <20140922143249 dot GC17454 at tucnak dot redhat dot com>
On Mon, 2014-09-22 at 16:32 +0200, Jakub Jelinek wrote:
> On Mon, Sep 22, 2014 at 10:22:59AM -0400, David Malcolm wrote:
> > On Sun, 2014-09-21 at 22:15 -0700, Andrew Pinski wrote:
> > > On Sun, Sep 21, 2014 at 8:08 PM, Steve Kargl
> > > <email@example.com> wrote:
> > > > On Sun, Sep 21, 2014 at 07:57:45PM -0700, Andrew Pinski wrote:
> > > >> On Sun, Sep 21, 2014 at 6:56 PM, Steve Kargl
> > > >> <firstname.lastname@example.org> wrote:
> > > >> > + is a binary operator. 0x3ffe is a hexidecimal-constant according
> > > >> > to 22.214.171.124 in n1256.pdf. 63 is, of course, a decimal-constant.
> > > >>
> > > >>
> > > >> This is before tokens happen and during lexing of the program.
> > > >> e+64 is exponent-part see 126.96.36.199.
> > > >
> > > > 188.8.131.52 applies to floating point constant.
> > > > 184.108.40.206 is for integer constants.
> > >
> > > Nope again, this time from bug 3885:
> > > Strange as it may seem, the behavior is correct, and mandated by the C
> > > Standard. 0x00E-0x00A is a single preprocessor token, of type
> > > pp-number, and it must become a single compiler token, but it can't.
> > > The gotcha is the `E-' sequence, that makes it seem like the exponent
> > > notation of floating-point constants.
> > >
> > > Looks like this is a common misunderstood part of C.
> > If people tend to get this wrong, should we issue a warning for it?
> We already diagnose it, with an error actually, not warning:
> error: invalid suffix "+63" on integer constant
> Just apparently people are surprised when the compiler diagnoses it.
> So perhaps some extra note explaining it (== hint how to fix that).
I've filed PR63337 with some ideas on how the error message could be
improved for this case.