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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Possibly related to bug 38341.

Note also that this simple change:

Index: c-common.c
===================================================================
--- c-common.c  (revision 204219)
+++ c-common.c  (working copy)
@@ -11236,11 +11236,11 @@ warn_for_sign_compare (location_t locati
             {
               mask = (~ (HOST_WIDE_INT) 0) << bits;
               if ((mask & constant) != mask)
                {
                  if (constant == 0)
-                   warning (OPT_Wsign_compare,
+                   warning_at (location, OPT_Wsign_compare,
                             "promoted ~unsigned is always non-zero");
                  else
                    warning_at (location, OPT_Wsign_compare,
                                "comparison of promoted ~unsigned with
constant");
                }


improves the caret information from:

small.c:6:3: warning: promoted ~unsigned is always non-zero [-Wsign-compare]
   return (val ^ (small_type_t)0xfffffffful) == 0;
   ^

to:

small.c:6:45: warning: promoted ~unsigned is always non-zero [-Wsign-compare]
   return (val ^ (small_type_t)0xfffffffful) != 0;
                                             ^

Reply via email to