This is the mail archive of the gcc-bugs@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]

[Bug c++/41561] warning on a large hex literal in C++ 0x mode



------- Comment #2 from msebor at gmail dot com  2009-10-04 16:08 -------
I'm not positive which stage issues the warning but the preprocessor does not
warn on large integer literals in preprocessor directives involving integer
arithmetic (e.g., #if 0x123456789abcd > LONG_MAX).

Strictly speaking, the warning isn't incorrect (it's true that 0x123456789abcd
is too large for the long type in ILP32), but it's also not relevant or useful
in any way. The section of the C++ 0x draft that I pointed to specifies that
the type of a hex integer literal with no suffix is the first standard integer
type from the following list in which the value of the literal can be
represented: int, unsigned int, long, unsigned long, long long, unsigned long
long. These are the same rules as in C which the C99 compiler interprets
without issuing a warning.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41561


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