This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50012] [4.5/4.6/4.7 Regression] C++ front end misses -Wsign-compare warnings when extraneous parentheses are present
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 07 Jan 2012 01:31:36 +0000
- Subject: [Bug c++/50012] [4.5/4.6/4.7 Regression] C++ front end misses -Wsign-compare warnings when extraneous parentheses are present
- Auto-submitted: auto-generated
- References: <bug-50012-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50012
--- Comment #7 from Ian Lance Taylor <ian at airs dot com> 2012-01-07 01:31:36 UTC ---
Created attachment 26260
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26260
Possible patch
I did not like the first approach because I think that checking c_dialect_cxx
in the generic C family code is quite ugly. But clearly the current approach
is problematic, and it's actually easy to implement Richi's suggestion. This
patch is a possible approach, but it doesn't work as is. It issues a warning
for
if (TYPE_QUALS (type) == memfn_quals)
in cp;typeck.c. Here memfn_quals is signed int but TYPE_QUALS, an expression
of enum values winds up unsigned.