From patchwork Sun Jul 29 21:29:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 28674 Received: (qmail 117952 invoked by alias); 29 Jul 2018 21:29:59 -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 117940 invoked by uid 89); 29 Jul 2018 21:29:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Attempt, 5049, 15287, H*Ad:U*tom X-HELO: gateway23.websitewelcome.com Received: from gateway23.websitewelcome.com (HELO gateway23.websitewelcome.com) (192.185.49.219) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 29 Jul 2018 21:29:57 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway23.websitewelcome.com (Postfix) with ESMTP id DD9466587 for ; Sun, 29 Jul 2018 16:29:55 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id jtGFfZG2lPvAdjtGFfcHU8; Sun, 29 Jul 2018 16:29:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QXObIQEQuiOldR7tGWl/XlP/PFF8rMoOahXbMMQFLb8=; b=OC+ohPXLcmPtpEcxLEwaBij9No xxKrfdD2Y/4H3hF0B10EndMWtM+Kj17aGg7WSQjU38Bnhd1CKr60aTWYZXUJToHWFrtFH/4+enxjr jegUhi1YtL3JIqOu43u4v5HDL; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:53664 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fjtGF-003yfg-Jq; Sun, 29 Jul 2018 16:29:55 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Remove old lint code Date: Sun, 29 Jul 2018 15:29:52 -0600 Message-Id: <20180729212952.28056-1-tom@tromey.com> This removes dead code that, according to the comments, existed to placate lint. I don't think this has been relevant in a long time, and certainly not since gdb switched to C++. Tested by rebuilding. ChangeLog 2018-07-29 Tom Tromey * cli/cli-decode.c (lookup_cmd): Remove lint code. * value.c (unpack_long): Remove lint code. * valops.c (value_ind): Remove lint code. * valarith.c (value_x_binop, value_x_unop, value_equal) (value_pos): Remove lint code. --- gdb/ChangeLog | 8 ++++++++ gdb/cli/cli-decode.c | 1 - gdb/valarith.c | 20 +++----------------- gdb/valops.c | 1 - gdb/value.c | 1 - 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index c8dda700ca8..83dd67efe3f 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -1561,7 +1561,6 @@ lookup_cmd (const char **line, struct cmd_list_element *list, } error (_("Ambiguous %scommand \"%s\": %s."), local_cmdtype, *line, ambbuf); - return 0; /* lint */ } } else diff --git a/gdb/valarith.c b/gdb/valarith.c index d2dd5900647..01ca50d3d21 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -504,9 +504,6 @@ value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op, } throw_error (NOT_FOUND_ERROR, _("member function %s not found"), tstr); -#ifdef lint - return call_function_by_hand (argvec[0], 2 - static_memfuncp, argvec + 1); -#endif } /* We know that arg1 is a structure, so try to find a unary user @@ -622,8 +619,6 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside) } throw_error (NOT_FOUND_ERROR, _("member function %s not found"), tstr); - - return 0; /* For lint -- never reached */ } @@ -1533,10 +1528,7 @@ value_equal (struct value *arg1, struct value *arg2) return value_strcmp (arg1, arg2) == 0; } else - { - error (_("Invalid type combination in equality test.")); - return 0; /* For lint -- never reached. */ - } + error (_("Invalid type combination in equality test.")); } /* Compare values based on their raw contents. Useful for arrays since @@ -1628,10 +1620,7 @@ value_pos (struct value *arg1) || (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type))) return value_from_contents (type, value_contents (arg1)); else - { - error (_("Argument to positive operation not a number.")); - return 0; /* For lint -- never reached. */ - } + error (_("Argument to positive operation not a number.")); } struct value * @@ -1663,10 +1652,7 @@ value_neg (struct value *arg1) return val; } else - { - error (_("Argument to negate operation not a number.")); - return 0; /* For lint -- never reached. */ - } + error (_("Argument to negate operation not a number.")); } struct value * diff --git a/gdb/valops.c b/gdb/valops.c index 9bdbf22b03c..de6f839c33c 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1588,7 +1588,6 @@ value_ind (struct value *arg1) } error (_("Attempt to take contents of a non-pointer value.")); - return 0; /* For lint -- never reached. */ } /* Create a value for an array by allocating space in GDB, copying the diff --git a/gdb/value.c b/gdb/value.c index af635ba5bc3..b0f22f1117e 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -2777,7 +2777,6 @@ unpack_long (struct type *type, const gdb_byte *valaddr) default: error (_("Value can't be converted to integer.")); } - return 0; /* Placate lint. */ } /* Unpack raw data (copied from debugee, target byte order) at VALADDR