I just ran the most excellent sourceforge tool "cppcheck" over the source
code of the GNU C compiler version 4.5 snapshot 20100107 and cppcheck said
lots of things. An extract is below.

[./libcpp/init.c:260]: (style) Redundant condition. It is safe to deallocate a
NULL pointer
[./libcpp/files.c:999]: (style) Redundant condition. It is safe to deallocate a
NULL pointer
[./libcpp/pch.c:725]: (style) Redundant condition. It is safe to deallocate a
NULL pointer
[./libcpp/pch.c:727]: (style) Redundant condition. It is safe to deallocate a
NULL pointer
[./libcpp/pch.c:729]: (style) Redundant condition. It is safe to deallocate a
NULL pointer

I've manually checked all of these and I agree with cppcheck -
the redundant conditions may be safely deleted.


-- 
           Summary: libcpp: five redundant tests
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dcb314 at hotmail dot com
  GCC host triplet: x86_64-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42669

Reply via email to