This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16517] warn about variables that are only ever assigned to, but never read
- From: "tneumann at pi3 dot informatik dot uni-mannheim dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jul 2004 14:52:28 -0000
- Subject: [Bug c++/16517] warn about variables that are only ever assigned to, but never read
- References: <20040713114911.16517.tneumann@pi3.informatik.uni-mannheim.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tneumann at pi3 dot informatik dot uni-mannheim dot de 2004-07-13 14:52 -------
(In reply to comment #2)
> I would disagree because people do this to make the warning go away.
The warning about unused variables? I would rather recommend to simple remove
the variable or if that is not possible to use __attribute__(unused).
But this is secondary, I don't really think your argument is valid. First of all
the warning could be disabled and second other compilers (like the Borland and
the Intel compiler) also warn about variables that are set but never read, so it
should not break too much existing code.
If you are really nervous about breaking existing code leave it disabled even at
-Wall -Wextra, although I don't see a reason for this.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16517