On 06/02/2008, Vincent Lefevre <[EMAIL PROTECTED]> wrote:
> On 2008-02-06 18:52:16 +0100, Manuel López-Ibáñez wrote:
> > 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).
>
> The problem is the cast (suggested by Dave Korn), not the enum itself:
> (int) 0x80001000
>

What is the problem with the cast? Do you want a warning for the
conversion that you asked for with the cast? We want about implicit
conversions with -Wconversion but if you use a cast, we understand
that you really mean to perform the conversion.

Notice that without -pedantic you don't need to do anything, the value
is kept as it is. With -pedantic, you don't need the cast either, it
is automatically converted to an int (yes, there is a conversion but
that is what the warning is telling you). If you use a cast, then you
perform the conversion yourself and there is nothing to warn about.

Cheers,

Manuel.

Reply via email to