From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23947 invoked by alias); 9 Jan 2010 08:50:54 -0000 Received: (qmail 23887 invoked by uid 48); 9 Jan 2010 08:50:42 -0000 Date: Sat, 09 Jan 2010 08:50:00 -0000 Subject: [Bug c++/42669] New: libcpp: five redundant tests X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dcb314 at hotmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-01/txt/msg01021.txt.bz2 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