This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Wrong warning? ISO C restricts enumerator values to range of ‘int’
On 06/02/2008, Vincent Lefevre <vincent+gcc@vinc17.org> wrote:
> You should get a warning in the cases where 0x80001000 isn't
> representable in an int because it is an implementation-defined
> behavior. Is there any reason why gcc doesn't issue one?
Maybe I don't understand what you are asking but from reading the code
and relevant testcases, it seems that:
* Unsigned integer constants for enum values are handled just fine by
GCC as a extension to the C language. (See testsuite/gcc.dg/enum1.c).
* Being an extension, it is warned by -pedantic.
So everything is working as expected, isn't it?
Cheers,
Manuel.