From patchwork Mon Apr 10 16:46:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Durigan Junior X-Patchwork-Id: 19945 Received: (qmail 66082 invoked by alias); 10 Apr 2017 16:46:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 65633 invoked by uid 89); 10 Apr 2017 16:46:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Apr 2017 16:46:55 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C5D7BC04B938 for ; Mon, 10 Apr 2017 16:46:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C5D7BC04B938 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=sergiodj@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C5D7BC04B938 Received: from psique.yyz.redhat.com (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED5D279587; Mon, 10 Apr 2017 16:46:51 +0000 (UTC) From: Sergio Durigan Junior To: GDB Patches Cc: Sergio Durigan Junior Subject: [obv/commit] Fix PR gdb/21364: Dead code due to an unreachable condition in osdata.c Date: Mon, 10 Apr 2017 12:46:49 -0400 Message-Id: <20170410164649.7563-1-sergiodj@redhat.com> X-IsSubscribed: yes Pedro's recent commits enabling -Wwrite-strings has changed a bit the logic of info_osdata. Now, 'type' is always non-NULL, so we have to check if it's an empty string instead of NULL. One of the checks was fixed, but there is another that was left behind. This commit fixes it. gdb/ChangeLog: 2017-04-10 Sergio Durigan Junior PR gdb/21364 * osdata.c (info_osdata): Check if 'type' is an empty string instead of NULL. --- gdb/ChangeLog | 6 ++++++ gdb/osdata.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e49e7a5..2302886 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2017-04-10 Sergio Durigan Junior + + PR gdb/21364 + * osdata.c (info_osdata): Check if 'type' is an empty string + instead of NULL. + 2017-04-10 Pedro Alves * thread.c (add_thread_silent, delete_thread_1, find_thread_ptid) diff --git a/gdb/osdata.c b/gdb/osdata.c index 4b33ccb..84c4ed7 100644 --- a/gdb/osdata.c +++ b/gdb/osdata.c @@ -318,7 +318,7 @@ info_osdata (const char *type) for a column named "Title", and only include it with MI output; this column's normal use is for titles for interface elements like menus, and it clutters up CLI output. */ - if (!type && !uiout->is_mi_like_p ()) + if (*type == '\0' && !uiout->is_mi_like_p ()) { struct osdata_column *col; int ix;