This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/30260] Enumeration types and enumeration constants erroneously given unsigned types



------- Comment #2 from joseph at codesourcery dot com  2006-12-19 21:22 -------
Subject: Re:  Enumeration types and enumeration constants
 erroneously given unsigned types

On Tue, 19 Dec 2006, pinskia at gcc dot gnu dot org wrote:

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

Read the testcase in the bug.  It doesn't use 0U - 1, it uses B1 - 1.  B1 
is an enumeration constant and so should have type int, regardless of the 
type of the expression used to set its value.  As such, the code is 
conforming and there is a GCC bug here.

There should be no diagnostic here, whether or not -pedantic is used, and 
there should be no dependence on -ansi or -pedantic for this testcase.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]