Bug 42669 - libcpp: five redundant tests
Summary: libcpp: five redundant tests
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 4.5.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-09 08:50 UTC by David Binderman
Modified: 2016-08-31 18:39 UTC (History)
2 users (show)

See Also:
Host: x86_64-suse-linux
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2010-01-09 08:50:41 UTC
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.
Comment 1 Paolo Carlini 2010-01-09 09:59:03 UTC
Didn't I tell you already that these issues are *not* suited for Bugzilla, because aren't user visible? Just mention the issue on gcc, or send a patch to gcc-patches.
Comment 2 Shakthi Kannan 2013-05-13 06:43:10 UTC
With cppcheck-1.59 on Fedora 18 (x86_64) and gcc-4.8.0, the "Redundant condition" is not present.
Comment 3 Manuel López-Ibáñez 2016-08-31 18:39:25 UTC
(In reply to Shakthi Kannan from comment #2)
> With cppcheck-1.59 on Fedora 18 (x86_64) and gcc-4.8.0, the "Redundant
> condition" is not present.

This probably got fixed on its own. Thanks anyway for reporting it.