This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16029] incorrect "unused variable" message from -Wall
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jun 2004 00:20:09 -0000
- Subject: [Bug c++/16029] incorrect "unused variable" message from -Wall
- References: <20040616232305.16029.tromey@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-06-17 00:20 -------
Well, that's error recovery: the compiler has to assume something when
encountering an error, before going on. In this case, it assumes that
'whatever' is a variable, and seems to tentatively inject a declaration
of it. Since the 'return' statement was in error, it is apparently not
considered a 'use' of this variable.
I am tempted to close this PR since it really is a case where one shouldn't
place too much emphasis on follow-up errors, given that the first error
is already pretty clear. However, it may also be easy enough to change the
compiler to mark all tentative variable and function declarations in error
recovery with __attribute__((used)) to avoid this kind of follow-up.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-06-17 00:20:08
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16029