This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16517] New: warn about unused assignment
- 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 11:49:12 -0000
- Subject: [Bug c++/16517] New: warn about unused assignment
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
It would be nice if the compiler could warn about useless assigments:
void foo()
{
int x;
x=42;
}
Here x seems to be "used", although it is never read. gcc does warn if x is
intialized at declaraton (s/;x=/=)
Tested with g++ -O3 -W -Wall and gcc -O3 -W -Wall,
gcc version 3.5.0 20040711 (experimental)
--
Summary: warn about unused assignment
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tneumann at pi3 dot informatik dot uni-mannheim dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16517