From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60295 invoked by alias); 25 Feb 2020 22:22:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 60285 invoked by uid 89); 25 Feb 2020 22:22:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.1 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.1 spammy=HX-Languages-Length:1361 X-HELO: gateway34.websitewelcome.com Received: from gateway34.websitewelcome.com (HELO gateway34.websitewelcome.com) (192.185.147.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Feb 2020 22:22:48 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway34.websitewelcome.com (Postfix) with ESMTP id C9FA120CADFC for ; Tue, 25 Feb 2020 16:22:46 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 6ibGjCvNFAGTX6ibGjMOCf; Tue, 25 Feb 2020 16:22:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qnXPsq3Aw6kj2mAhk41f2j5RLIsA1JUmqNcZ//O1c/Q=; b=g3LyOAfnI7VBeazKKHOaEZwPfd Eg7/ffrywTIQS1Wl4SFABKgV9l0ybavPE/Cbm4LQ3WYMGW2fAxjVNPORnfwDoYffiOX4SYXR7WWSH PBxqKqV9z/qrJL7woX1Q4m/VR; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:55644 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j6ibG-000r0B-Ge; Tue, 25 Feb 2020 15:22:46 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c Date: Tue, 25 Feb 2020 22:22:00 -0000 Message-Id: <20200225222243.8260-4-tom@tromey.com> In-Reply-To: <20200225222243.8260-1-tom@tromey.com> References: <20200225222243.8260-1-tom@tromey.com> X-SW-Source: 2020-02/txt/msg00959.txt.bz2 Some arm-tdep.c data structures use a bfd_vma. A couple of spots will warn about an implicit narrowing cast when building a gdb where CORE_ADDR is 64-bit but bfd_vma is 32-bit. This patch silences these warnings by introducing an explicit cast. This seemed both simplest and correct. 2020-02-25 Tom Tromey * arm-tdep.c (map_key, arm_find_exidx_entry): Cast to bfd_vma. --- gdb/ChangeLog | 4 ++++ gdb/arm-tdep.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 175c5b956e7..d395c7f7b75 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -366,7 +366,7 @@ arm_find_mapping_symbol (CORE_ADDR memaddr, CORE_ADDR *start) } struct arm_mapping_symbol map_key - = { memaddr - obj_section_addr (sec), 0 }; + = { (bfd_vma) (memaddr - obj_section_addr (sec)), 0 }; arm_mapping_symbol_vec::const_iterator it = std::lower_bound (map.begin (), map.end (), map_key); @@ -2246,7 +2246,8 @@ arm_find_exidx_entry (CORE_ADDR memaddr, CORE_ADDR *start) if (sec != NULL) { struct arm_exidx_data *data; - struct arm_exidx_entry map_key = { memaddr - obj_section_addr (sec), 0 }; + struct arm_exidx_entry map_key + = { (bfd_vma) (memaddr - obj_section_addr (sec)), 0 }; data = arm_exidx_data_key.get (sec->objfile->obfd); if (data != NULL) -- 2.17.2