This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/34351] Please get us the "volatile register" warning back
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Dec 2007 13:03:55 -0000
- Subject: [Bug c/34351] Please get us the "volatile register" warning back
- References: <bug-34351-11199@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from manu at gcc dot gnu dot org 2007-12-13 13:03 -------
Moreover, the option is defined in common.opt when it is C/C++ specific.
Untested patch:
Index: gcc/common.opt
===================================================================
--- gcc/common.opt (revision 130605)
+++ gcc/common.opt (working copy)
@@ -213,10 +213,6 @@
Common Var(warn_unused_variable) Warning
Warn when a variable is unused
-Wvolatile-register-var
-Common Var(warn_register_var) Warning
-Warn when a register variable is declared volatile
-
Wcoverage-mismatch
Common RejectNegative Var(warn_coverage_mismatch) Warning
Warn instead of error in case profiles in -fprofile-use do not match
Index: gcc/c.opt
===================================================================
--- gcc/c.opt (revision 130605)
+++ gcc/c.opt (working copy)
@@ -465,6 +465,10 @@
C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning
Warn if a variable length array is used
+Wvolatile-register-var
+C ObjC C++ ObjC++ Var(warn_volatile_register_var) Warning
+Warn when a register variable is declared volatile
+
Wwrite-strings
C ObjC C++ ObjC++ Var(warn_write_strings) Warning
In C++, nonzero means warn about deprecated conversion from string literals to
`char *'. In C, similar warning, except that the conversion is of course not
deprecated by the ISO C standard.
Index: gcc/c-opts.c
===================================================================
--- gcc/c-opts.c (revision 130605)
+++ gcc/c-opts.c (working copy)
@@ -405,6 +405,7 @@
warn_address = value;
warn_strict_overflow = value;
warn_array_bounds = value;
+ warn_volatile_register_var = value;
/* Only warn about unknown pragmas that are not in system
headers. */
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi (revision 130605)
+++ gcc/doc/invoke.texi (working copy)
@@ -2656,6 +2656,7 @@
-Wunused-label @gol
-Wunused-value @gol
-Wunused-variable @gol
+-Wvolatile-register-var @gol
}
Note that some warning flags are not implied by @option{-Wall}. Some of
@@ -3902,7 +3903,8 @@
@opindex Wno-volatile-register-var
Warn if a register variable is declared volatile. The volatile
modifier does not inhibit all optimizations that may eliminate reads
-and/or writes to register variables.
+and/or writes to register variables. This warning is enabled by
+@option{-Wall}.
@item -Wdisabled-optimization
@opindex Wdisabled-optimization
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-12-13 13:03:53
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34351