This is the mail archive of the gcc-patches@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]

Re: PR c/51712 -Wtype-limits should not trigger for types of implementation-defined signedness


On Tue, 1 May 2012, Manuel López-Ibáñez wrote:

> > Are you sure you want STRIP_NOPS rather than STRIP_SIGN_NOPS here? ?If so,
> > could you ensure there are comments explaining why removing sign changes
> > is safe in this context?
> 
> For getting the original enumeral type of a expr, why would sign changes matter?

What if the comparison is

  (unsigned) (expr_of_signed_enum_type) >= 0

?  (With GCC, the enum will have a signed type if one of its values is 
negative.)  That seems worth a warning - the point of the patch as I 
understand it is to avoid warning for

  (expr_of_unsigned_enum_type) >= 0

because being unsigned there is an implementation-defined matter.

-- 
Joseph S. Myers
joseph@codesourcery.com

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