c++/3747

Martin Sebor sebor@roguewave.com
Sat Oct 20 14:53:00 GMT 2001


Jan van Dijk wrote:
> 
...
> 
> 1) If gcc-3 is correct, it seems that every other compiler out there is
> wrong. Every compiler I know of accepts this code.

At least three other compilers in addition to gcc reject the code: recent
versions pf the EDG front end (and, obviously, all compilers based on it,
e.g., Comeau C++), IBM VisualAge 5.0 and even MSVC.

>
...
> 
> 2) Out of curiosity, where in the standard is it stated explicitly that
> 0 is of type int, rather than unsigned?

2.13.1, p2: "The type of an integer literal depends on its form, value,
and suffix. If it is decimal and has no suffix, it has the first of these
types in which its value can be represented: int, long int; ..."

Regards
Martin



More information about the Gcc-bugs mailing list