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: PATCH RFA: C++: Avoid inappropriate -Wsign-compare warnings


Ian Lance Taylor wrote:
Here is a better patch to address the problem described in some detail
in http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01393.html .  In this
patch I simply set TREE_NO_WARNING for cases where we are using a
builtin operator and we have cast an unsigned enum type to a signed
integral type.  Then I test TREE_NO_WARNING before calling
warn_sign_compare.

I'm wondering what happens for unsigned enums whose biggest member is >= 2^31. Maybe you have to test TYPE_PRECISION in avoid_sign_compare_warnings?


Paolo


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