This is the mail archive of the 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: Is this a compiler bug?

On Sun, Sep 21, 2014 at 7:49 PM, Ed Smith-Rowland <> wrote:
> On 09/21/2014 09:56 PM, Steve Kargl wrote:
>> + is a binary operator.  0x3ffe is a hexidecimal-constant according
>> to in n1256.pdf.  63 is, of course, a decimal-constant.
> Also, a hex floating point uses p as an exponent for this reason...
> These should just be adding integers.
>     i = 0x3ffe+63; /* integral */
>     i = 0x3ffp+63; /* floating point */
> Post the PR.
> I did a lot of stuff in this area for C++11 user-defined literals.
> I either caused it of I might be able to help.

6.4.8 is what matters here.  pp-number is defined as:
pp-number e sign
pp-number E sign
pp-number identifier-nondigit

And /3 says:
Preprocessing number tokens lexically include all floating and integer
constant tokens.

And /4 says:
A preprocessing number does not have type or a value; it acquires both
after a successful
conversion (as part of translation phase 7) to a floating constant
token or an integer
constant token.

So we have 0x3ffe+63 as one token (a pp-number) but it is not a
successive token to either a floating point token or an integer
constant token so it is rejected.

Andrew Pinski

> Ed

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