Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ahMTA-00023L-R4 for pgsql-committers@arkaria.postgresql.org; Sat, 19 Mar 2016 19:23:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ahMTA-0001gt-7t for pgsql-committers@arkaria.postgresql.org; Sat, 19 Mar 2016 19:23:28 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ahMSx-0001Su-Fn for pgsql-committers@postgresql.org; Sat, 19 Mar 2016 19:23:15 +0000 Received: from jiboia.ensmp.fr ([194.214.158.137]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ahMSu-0004dB-2E for pgsql-committers@postgresql.org; Sat, 19 Mar 2016 19:23:13 +0000 Received: from cri.ensmp.fr (152.200.219.88.rev.sfr.net [88.219.200.152]) (authenticated bits=0) by jiboia.ensmp.fr (8.15.2/8.15.1/JMMC-22/Oct/2013) with ESMTPSA id u2JJN5xO007577 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Mar 2016 20:23:06 +0100 Date: Sat, 19 Mar 2016 20:23:03 +0100 (CET) From: Fabien COELHO X-X-Sender: fabien@sto To: Tom Lane cc: Alvaro Herrera , pgsql-committers@postgresql.org Subject: Re: pgsql: pgbench: Allow changing weights for scripts In-Reply-To: <5763.1458413125@sss.pgh.pa.us> Message-ID: References: <5763.1458413125@sss.pgh.pa.us> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Miltered: at jiboia.ensmp.fr with ID 56EDA719.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Auth: USER-ID fabien.coelho X-j-chkmail-Enveloppe: 56EDA719.000 from 152.200.219.88.rev.sfr.net/152.200.219.88.rev.sfr.net/88.219.200.152/cri.ensmp.fr/ X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org > pgbench.c:2765: warning: 'ps.stats.lag.sum2' is used uninitialized in this function Sorry for the noise. Strangely, I did not get that warning with gcc 4.8.4. ISTM that in stack variables are initialized to zero automatically, so although it is not explicitely initialized, it is not uninitialized... Moreover, these values are not actually "used" in the function, they are just returned, and are to be initialized explicitely later on. So gcc is wrong, but that does not mean that it should not be fixed. Alvaro has just done that, which is overall a code improvement, so it is for the better, and it shows that a wrong warning can lead to actual benefits:-) -- Fabien. -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers