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]

trivial fix for -Wsequence-point


Hi,

This one-liner, trivial, it-can't-go-wrong, patch makes
-fdiagnostics-show-option to print -Wsequence-point and allows to use
-Werror=sequence-point.

I know this is not a regression but it is so trivial I was almost
tempted to commit it as obvious.

OK for GCC 4.3 and GCC 4.2 when it finishes regression tests?


2008-02-18  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

  * c-common.c (warn_for_collisions_1): Use appropriate option when warning.


Index: gcc/c-common.c
===================================================================
--- gcc/c-common.c      (revision 132310)
+++ gcc/c-common.c      (working copy)
@@ -1526,11 +1526,12 @@ warn_for_collisions_1 (tree written, tre
          && list->writer != writer
          && (!only_writes || list->writer)
          && DECL_NAME (list->expr))
        {
          warned_ids = new_tlist (warned_ids, written, NULL_TREE);
-         warning (0, "operation on %qE may be undefined", list->expr);
+         warning (OPT_Wsequence_point, "operation on %qE may be undefined",
+                  list->expr);
        }
       list = list->next;
     }
 }


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