From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22647 invoked by alias); 6 Dec 2011 19:33:35 -0000 Received: (qmail 22637 invoked by uid 22791); 6 Dec 2011 19:33:35 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-yx0-f201.google.com (HELO mail-yx0-f201.google.com) (209.85.213.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Dec 2011 19:33:19 +0000 Received: by yenq10 with SMTP id q10so25954yen.0 for ; Tue, 06 Dec 2011 11:33:18 -0800 (PST) Received: by 10.236.190.200 with SMTP id e48mr48290047yhn.5.1323199998957; Tue, 06 Dec 2011 11:33:18 -0800 (PST) Received: by 10.236.190.200 with SMTP id e48mr48290038yhn.5.1323199998868; Tue, 06 Dec 2011 11:33:18 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id n21si33090yba.1.2011.12.06.11.33.18 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 06 Dec 2011 11:33:18 -0800 (PST) Received: from wpaz9.hot.corp.google.com (wpaz9.hot.corp.google.com [172.24.198.73]) by wpzn3.hot.corp.google.com (Postfix) with ESMTPS id C638810004D; Tue, 6 Dec 2011 11:33:18 -0800 (PST) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.110.50]) by wpaz9.hot.corp.google.com with ESMTP id pB6JXHmI000533; Tue, 6 Dec 2011 11:33:17 -0800 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id 5CEAF2461D7; Tue, 6 Dec 2011 11:33:17 -0800 (PST) To: tromey@redhat.com cc: gdb-patches@sourceware.org Subject: * linespec.c (decode_dollar): Avoid "may be used uninitialized" warning. Message-Id: <20111206193317.5CEAF2461D7@ruffy.mtv.corp.google.com> Date: Tue, 06 Dec 2011 19:56:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2011-12/txt/msg00199.txt.bz2 Hi. I'm not sure how you want to fix this. cc1: warnings being treated as errors ../../src/gdb/linespec.c: In function 'decode_dollar': ../../src/gdb/linespec.c:2549: error: 'values.nelts' may be used uninitialized in this function ../../src/gdb/linespec.c:2549: error: 'values.sals' may be used uninitialized in this function make[2]: *** [linespec.o] Error 1 2011-12-06 Doug Evans * linespec.c (decode_dollar): Avoid "may be used uninitialized" warning. Index: linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.132 diff -u -p -r1.132 linespec.c --- linespec.c 6 Dec 2011 18:54:39 -0000 1.132 +++ linespec.c 6 Dec 2011 19:31:19 -0000 @@ -2494,6 +2494,10 @@ decode_dollar (struct linespec_state *se volatile struct gdb_exception exc; + /* Avoid "may be used uninitialized" warning. */ + values.sals = NULL; + values.nelts = 0; + TRY_CATCH (exc, RETURN_MASK_ERROR) { values = decode_variable (self, copy);