------- Comment #1 from pinskia at gcc dot gnu dot org  2006-12-19 21:05 -------
C99 6.7.2.2 does not say that.

Read 6.7.2.2 which says:
> The expression that defines the value of an enumeration constant shall be an
> integer constant expression that has a value representable as an int.

So the error with -pedantic is correct as 0U - 1 is not representable as an
int.

Also:
Read 6.7.2.2/4 which says:
> Each enumerated type shall be compatible with char, a signed integer type, or 
> an
> unsigned integer type. The choice of type is implementation-defined,108) but 
> shall be capable of representing the values of all the members of the
> enumeration. The enumerated type is incomplete until after the } that
> terminates the list of enumerator declarations.

http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Structures-unions-enumerations-and-bit_002dfields-implementation.html
Specifies our implementation-defined behavior.


Now we do have different code with -pedantic and without -pedantic and that is
a bug but that is PR 15236.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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

Reply via email to