* [PATCH] Add option -Wno-mudflap to silence warning triggered by -fmudflap
@ 2008-01-21 14:25 Volker Reichelt
2008-01-24 19:18 ` Ian Lance Taylor
0 siblings, 1 reply; 3+ messages in thread
From: Volker Reichelt @ 2008-01-21 14:25 UTC (permalink / raw)
To: gcc-patches
Right now the only way to disable warnings triggered by -fmudflap is to use
the flag "-w". The following patch adds the option -Wno-mudflap to silence
these warnings and documents it.
Bootstrapped and regtested on i686-pc-linux-gnu.
Ok for mainline?
Regards,
Volker
:ADDPATCH mudflap:
2008-01-21 Volker Reichelt <v.reichelt@netcologne.de>
* common.opt (Wmudflap): New option.
* tree-mudflap.c (mf_xform_derefs_1): Guard warning by OPT_Wmudflap.
(mx_register_decls): Likewise.
(mudflap_finish_file): Likewise.
* doc/invoke.texi: Document -Wno-mudflap.
===================================================================
--- gcc/common.opt (revision 131273)
+++ gcc/common.opt (working copy)
@@ -129,6 +129,10 @@
Common Var(warn_missing_noreturn) Warning
Warn about functions which might be candidates for __attribute__((noreturn))
+Wmudflap
+Common Var(warn_mudflap) Init(1) Warning
+Warn about constructs not instrumented by -fmudflap
+
Woverflow
Common Var(warn_overflow) Init(1) Warning
Warn about overflow in arithmetic expressions
===================================================================
--- gcc/tree-mudflap.c (revision 131273)
+++ gcc/tree-mudflap.c (working copy)
@@ -861,7 +861,8 @@
break;
case ARRAY_RANGE_REF:
- warning (0, "mudflap checking not yet implemented for ARRAY_RANGE_REF");
+ warning (OPT_Wmudflap,
+ "mudflap checking not yet implemented for ARRAY_RANGE_REF");
return;
case BIT_FIELD_REF:
@@ -1047,7 +1048,8 @@
if (tsi_end_p (initially_stmts))
{
if (!DECL_ARTIFICIAL (decl))
- warning (0, "mudflap cannot track %qs in stub function",
+ warning (OPT_Wmudflap,
+ "mudflap cannot track %qs in stub function",
IDENTIFIER_POINTER (DECL_NAME (decl)));
}
else
@@ -1276,7 +1278,8 @@
if (! COMPLETE_TYPE_P (TREE_TYPE (obj)))
{
- warning (0, "mudflap cannot track unknown size extern %qs",
+ warning (OPT_Wmudflap,
+ "mudflap cannot track unknown size extern %qs",
IDENTIFIER_POINTER (DECL_NAME (obj)));
continue;
}
===================================================================
--- gcc/doc/invoke.texi 2008-01-19 22:00:04 +0100
+++ gcc/doc/invoke.texi 2008-01-20 21:18:07 +0100
@@ -244,7 +244,7 @@ Objective-C and Objective-C++ Dialects}.
-Wlogical-op -Wlong-long @gol
-Wmain -Wmissing-braces -Wmissing-field-initializers @gol
-Wmissing-format-attribute -Wmissing-include-dirs @gol
--Wmissing-noreturn @gol
+-Wmissing-noreturn -Wno-mudflap @gol
-Wno-multichar -Wnonnull -Wno-overflow @gol
-Woverlength-strings -Wpacked -Wpadded @gol
-Wparentheses -Wpointer-arith -Wno-pointer-to-int-cast @gol
@@ -3934,6 +3934,11 @@ This option is only supported for C and
This option is only active when @option{-fstack-protector} is active. It
warns about functions that will not be protected against stack smashing.
+@item -Wno-mudflap
+@opindex Wno-mudflap
+Suppress warnings about constructs that cannot be instrumented by
+@option{-fmudflap}.
+
@item -Woverlength-strings
@opindex Woverlength-strings
Warn about string constants which are longer than the ``minimum
===================================================================
2008-01-21 Volker Reichelt <v.reichelt@netcologne.de>
* testsuite/libmudflap.c/pass63-frag.c: New test.
===================================================================
--- libmudflap/testsuite/libmudflap.c/pass63-frag.c 2003-09-23 19:59:22 +0200
+++ libmudflap/testsuite/libmudflap.c/pass63-frag.c 2008-01-20 21:37:24 +0100
@@ -0,0 +1,6 @@
+/* Check -Wno-mudflap flag */
+/* { dg-do compile } */
+/* { dg-options "-fmudflap -Wno-mudflap" } */
+
+extern char x[];
+int main() { return x[3]; } /* { dg-bogus "mudflap cannot track" } */
===================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Add option -Wno-mudflap to silence warning triggered by -fmudflap
2008-01-21 14:25 [PATCH] Add option -Wno-mudflap to silence warning triggered by -fmudflap Volker Reichelt
@ 2008-01-24 19:18 ` Ian Lance Taylor
2008-03-20 16:51 ` Volker Reichelt
0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2008-01-24 19:18 UTC (permalink / raw)
To: Volker Reichelt; +Cc: gcc-patches
Volker Reichelt <v.reichelt@netcologne.de> writes:
> 2008-01-21 Volker Reichelt <v.reichelt@netcologne.de>
>
> * common.opt (Wmudflap): New option.
> * tree-mudflap.c (mf_xform_derefs_1): Guard warning by OPT_Wmudflap.
> (mx_register_decls): Likewise.
> (mudflap_finish_file): Likewise.
> * doc/invoke.texi: Document -Wno-mudflap.
This is OK for gcc 4.4. gcc mainline is closed to new features.
Thanks.
:REVIEWMAIL:
Ian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Add option -Wno-mudflap to silence warning triggered by -fmudflap
2008-01-24 19:18 ` Ian Lance Taylor
@ 2008-03-20 16:51 ` Volker Reichelt
0 siblings, 0 replies; 3+ messages in thread
From: Volker Reichelt @ 2008-03-20 16:51 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches
On 24 Jan, Ian Lance Taylor wrote:
> Volker Reichelt <v.reichelt@netcologne.de> writes:
>
>> 2008-01-21 Volker Reichelt <v.reichelt@netcologne.de>
>>
>> * common.opt (Wmudflap): New option.
>> * tree-mudflap.c (mf_xform_derefs_1): Guard warning by OPT_Wmudflap.
>> (mx_register_decls): Likewise.
>> (mudflap_finish_file): Likewise.
>> * doc/invoke.texi: Document -Wno-mudflap.
>
> This is OK for gcc 4.4. gcc mainline is closed to new features.
>
> Thanks.
>
> :REVIEWMAIL:
>
> Ian
Finally committed to 4.4. http://gcc.gnu.org/ml/gcc-cvs/2008-03/msg00604.html
Regards,
Volker
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-03-20 16:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-21 14:25 [PATCH] Add option -Wno-mudflap to silence warning triggered by -fmudflap Volker Reichelt
2008-01-24 19:18 ` Ian Lance Taylor
2008-03-20 16:51 ` Volker Reichelt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).