This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48816] New: possible pointless code in file cxx-pretty-print.c, line 2136
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 Apr 2011 09:29:40 +0000
- Subject: [Bug c++/48816] New: possible pointless code in file cxx-pretty-print.c, line 2136
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48816
Summary: possible pointless code in file cxx-pretty-print.c,
line 2136
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: trivial
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: dcb314@hotmail.com
I just ran the static analysis tool, cppcheck, over
the source code of the latest 4.7 snapshot, 20110423,
and it said
[cxx-pretty-print.c:2136]: (style) Variable 'i' is assigned a value that is
never used
I've checked the code and I agree with cppcheck.
Suggest remove pointless variable.
I am not sure why the existing functionality for set-but-not-used variables
in gcc didn't catch this one. Maybe this existing functionality might
benefit from enhancement.