This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16139] Wrong warnings (unused variable) reported for the code provided when -Wall is used
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jun 2004 17:24:26 -0000
- Subject: [Bug c++/16139] Wrong warnings (unused variable) reported for the code provided when -Wall is used
- References: <20040622150359.16139.kgardas@objectsecurity.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-06-22 17:24 -------
Well, I wouldn't call it "invalid", just "infeasible". Note that all the
variables you don't get warnings about have non-trivial constructors that
have side effects. Sometimes, as in some patterns, a con/destructor call is
the only interesting effect of a class, the variable is actually not
used otherwise. To prevent warnings in these cases, the compiler can't]
warn you in the cases you show.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16139