From patchwork Mon Aug 3 12:43:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 7979 Received: (qmail 55007 invoked by alias); 3 Aug 2015 12:43:54 -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 54991 invoked by uid 89); 3 Aug 2015 12:43:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: e06smtp16.uk.ibm.com Received: from e06smtp16.uk.ibm.com (HELO e06smtp16.uk.ibm.com) (195.75.94.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 03 Aug 2015 12:43:52 +0000 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 3 Aug 2015 13:43:48 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 3 Aug 2015 13:43:46 +0100 X-MailFrom: uweigand@de.ibm.com X-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9D5C82190066 for ; Mon, 3 Aug 2015 13:43:18 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t73ChgxA36831330 for ; Mon, 3 Aug 2015 12:43:43 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t73ChgJe016460 for ; Mon, 3 Aug 2015 06:43:42 -0600 Received: from oc7340732750.ibm.com (dyn-9-152-213-24.boeblingen.de.ibm.com [9.152.213.24]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t73Chgvh016457; Mon, 3 Aug 2015 06:43:42 -0600 Received: by oc7340732750.ibm.com (Postfix, from userid 500) id 68148B043; Mon, 3 Aug 2015 14:43:42 +0200 (CEST) Subject: [commit] Fix build error due to uninitialized variable warning To: gdb-patches@sourceware.org Date: Mon, 3 Aug 2015 14:43:42 +0200 (CEST) From: "Ulrich Weigand" Cc: derodat@adacore.com MIME-Version: 1.0 Message-Id: <20150803124342.68148B043@oc7340732750.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15080312-0025-0000-0000-00000644CD79 Hello, as of commit a5fdf78a4402341a0ae23a5ca8a63825e2b5286c, building GDB with a GCC 4.1 host compiler fails with: gdb/cp-namespace.c: In function 'cp_lookup_symbol_via_imports': gdb/cp-namespace.c:482: warning: 'sym.block' may be used uninitialized in this function Apparently, more recent compilers are able to deduce that no actual uninitialized use of sym.block takes place, but GCC 4.1 isn't yet able to do that. Fixed by adding an explicit initalization. Bye, Ulrich ChangeLog: * cp-namespace.c (cp_lookup_symbol_via_imports): Fix uninitialized variable warning with some compilers. diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index aa29c92..f5f4bad 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -485,6 +485,7 @@ cp_lookup_symbol_via_imports (const char *scope, struct cleanup *searched_cleanup; sym.symbol = NULL; + sym.block = NULL; /* First, try to find the symbol in the given namespace if requested. */ if (search_scope_first)