This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/81345] -Wall resets default option arguments to 1
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Jul 2017 19:58:14 +0000
- Subject: [Bug driver/81345] -Wall resets default option arguments to 1
- Auto-submitted: auto-generated
- References: <bug-81345-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81345
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|-Wall resets |-Wall resets default option
|-Wstringop-overflow to 1 |arguments to 1
|from the default 2 |
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Applying the patch below makes it clear that -Wall resets the default option
argument to 1:
$ gcc -S -Wall -xc - </dev/null
cc1: note: warn_foobar=1
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 3d96bf5..bfa1072 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -732,6 +732,9 @@ C ObjC C++ ObjC++ Joined RejectNegative UInteger
Var(warn_stringop_overflow) Ini
Under the control of Object Size type, warn about buffer overflow in string
manipulation functions like memcpy and strcpy.
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 3d96bf5..584ebc0 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -342,6 +342,9 @@ Wbool-operation
C ObjC C++ ObjC++ Var(warn_bool_op) Warning LangEnabledBy(C ObjC C++
ObjC++,Wall)
Warn about certain operations on boolean expressions.
+Wfoobar
+C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_foobar) Init(123)
Warning LangEnabledBy(C ObjC C++ ObjC++, Wall)
+
Wframe-address
C ObjC C++ ObjC++ Var(warn_frame_address) Warning LangEnabledBy(C ObjC C++
ObjC++,Wall)
Warn when __builtin_frame_address or __builtin_return_address is used
unsafely.
diff --git a/gcc/toplev.c b/gcc/toplev.c
index e6c69a4..3697c48 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2147,6 +2147,8 @@ toplev::main (int argc, char **argv)
if (help_flag)
print_plugins_help (stderr, "");
+ inform (UNKNOWN_LOCATION, "warn_foobar=%i", warn_foobar);
+
/* Exit early if we can (e.g. -help). */
if (!exit_after_options)
{