From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82599 invoked by alias); 18 May 2016 16:17:56 -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 82585 invoked by uid 89); 18 May 2016 16:17:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*MI:tromey, daily, 4.1 X-HELO: gproxy9-pub.mail.unifiedlayer.com Received: from gproxy9-pub.mail.unifiedlayer.com (HELO gproxy9-pub.mail.unifiedlayer.com) (69.89.20.122) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Wed, 18 May 2016 16:17:41 +0000 Received: (qmail 10495 invoked by uid 0); 18 May 2016 16:17:37 -0000 Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy9.mail.unifiedlayer.com with SMTP; 18 May 2016 16:17:37 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id vsHR1s0182f2jeq01sHUgR; Wed, 18 May 2016 10:17:37 -0600 X-Authority-Analysis: v=2.1 cv=cYhB8BzM c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=PnD2wP_eR3oA:10 a=_v2sUkyEFrwA:10 a=yrkiwgmsf1kA:10 a=VnNF1IyMAAAA:8 a=zstS-IiYAAAA:8 a=cp5Va0OVEMIpPshEEwkA:9 a=skCgnbhlp52w9zbo2JeP:22 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from [71.215.116.141] (port=40822 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1b34A1-0004re-JY; Wed, 18 May 2016 10:17:25 -0600 From: Tom Tromey To: "Ulrich Weigand" Cc: tom@tromey.com (Tom Tromey), gdb-patches@sourceware.org Subject: Re: [FYI v3 5/8] Add support for the Rust language References: <20160518134628.6F08A1CB9@oc7340732750.ibm.com> Date: Wed, 18 May 2016 16:17:00 -0000 In-Reply-To: <20160518134628.6F08A1CB9@oc7340732750.ibm.com> (Ulrich Weigand's message of "Wed, 18 May 2016 15:46:28 +0200 (CEST)") Message-ID: <87lh37xrvx.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 71.215.116.141 authed with tom+tromey.com} X-SW-Source: 2016-05/txt/msg00307.txt.bz2 >>>>> "Ulrich" == Ulrich Weigand writes: Ulrich> This causes a build failure on my RHEL5 daily build for SPU, Ulrich> which uses a GCC 4.1 host compiler: Ulrich> gdb/rust-lang.c: In function 'value* rust_subscript(expression*, int*, Ulrich> noside, int)': Ulrich> gdb/rust-lang.c:1311: warning: 'high' may be used uninitialized in this function Could you try the appended? If it works for you I will check it in. Tom diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b7a6351..073d482 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2016-05-18 Tom Tromey + + * rust-lang.c (rust_subscript): Initialize "high". + 2016-05-17 Tom Tromey * std-operator.def (OP_RANGE): Rename from OP_F90_RANGE. diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index b8af166..5df99ce 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -1308,9 +1308,10 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, { struct value *lhs, *rhs, *result; struct type *rhstype; - LONGEST low, high, high_bound; + LONGEST low, high_bound; /* Initialized to appease the compiler. */ enum range_type kind = BOTH_BOUND_DEFAULT; + LONGEST high = 0; int want_slice = 0; ++*pos;