summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-22 15:54:05 +0000
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-22 15:54:05 +0000
commit0d438110c521e5799218007ecec7f3e1cb919bb7 (patch)
treeb213317c3f34e3c03d9cc572db411c63b2179ffe /gcc/function.c
parentd819917f8654510afb127bf5e8cfce701f8c930d (diff)
downloadgcc-0d438110c521e5799218007ecec7f3e1cb919bb7.tar.gz
2006-12-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR middle-end/7651 * c.opt (Wclobbered): New. * doc/invoke.texi (Wclobbered): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * flow.c (rest_of_handle_life): Replace Wextra with Wclobbered. * function.c (setjmp_vars_warning): Only warn for Wclobbered. (setjmp_args_warning): Likewise. testsuite/ * gcc.dg/attr-returns_twice-1.c: Replace Wextra with Wclobbered. * gcc.dg/setjmp-1.c: Add explicit Wclobbered. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120151 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/function.c b/gcc/function.c
index b61b9004a78..581c0834d44 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3536,9 +3536,8 @@ setjmp_vars_warning (tree block)
&& DECL_RTL_SET_P (decl)
&& REG_P (DECL_RTL (decl))
&& regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl))))
- warning (0, "variable %q+D might be clobbered by %<longjmp%>"
- " or %<vfork%>",
- decl);
+ warning (OPT_Wclobbered, "variable %q+D might be clobbered by"
+ " %<longjmp%> or %<vfork%>", decl);
}
for (sub = BLOCK_SUBBLOCKS (block); sub; sub = TREE_CHAIN (sub))
@@ -3557,7 +3556,8 @@ setjmp_args_warning (void)
if (DECL_RTL (decl) != 0
&& REG_P (DECL_RTL (decl))
&& regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl))))
- warning (0, "argument %q+D might be clobbered by %<longjmp%> or %<vfork%>",
+ warning (OPT_Wclobbered,
+ "argument %q+D might be clobbered by %<longjmp%> or %<vfork%>",
decl);
}