------- Comment #5 from manu at gcc dot gnu dot org  2008-02-15 11:25 -------
I am not sure how we want to fix this bug. 

A possible fix is to have 2 behaviours, one with -std=cX and another with
-std=gnuX. So, for -std=cX we always convert enum values to integer, while for
-std=gnuX we don't. Currently , this is what is implemented for -pedantic (see
PR15236). This is wrong to do for -pedantic, but may be ok for the -std=
switch.

Otherwise, we could just unconditionally convert anything that fits into a
signed integer into signed integer. That is, 

enum A {A1 = 0, A2 = A1 - 1};
enum B {B1 = 0u, B2 = B1 - 1};

will produce the same result. While

enum A {A1 = (int)0x80001000, A2 = A1 - 1};
enum B {B1 = 0x80001000, B2 = B1 - 1};

won't.

Joseph, what do you think?
Any more ideas?


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2008-02-12 14:25:48         |2008-02-15 11:25:52
               date|                            |


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

Reply via email to