This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
trivial fix for -Wsequence-point
- From: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Feb 2008 23:47:41 +0100
- Subject: 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;
}
}