This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/48816] New: possible pointless code in file cxx-pretty-print.c, line 2136


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]