pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: pgbench: Allow changing weights for scripts
Date: Sat, 19 Mar 2016 20:23:03 +0100 (CET)
Message-ID: <alpine.DEB.2.10.1603192012310.7678@sto> (raw)
In-Reply-To: <5763.1458413125@sss.pgh.pa.us>
References: <E1ahIuH-0002LL-Ok@gemulon.postgresql.org>
	<5763.1458413125@sss.pgh.pa.us>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>


> 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



view thread (6+ messages)  latest in thread

Message-ID: <alpine.DEB.2.10.1603192012310.7678@sto>
Permalink:  ../alpine.DEB.2.10.1603192012310.7678@sto/
Also on:    postgresql.org/message-id/alpine.DEB.2.10.1603192012310.7678@sto

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: coelho@cri.ensmp.fr, tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org
  Subject: Re: pgsql: pgbench: Allow changing weights for scripts
  In-Reply-To: <alpine.DEB.2.10.1603192012310.7678@sto>
  References: <E1ahIuH-0002LL-Ok@gemulon.postgresql.org> <5763.1458413125@sss.pgh.pa.us> <alpine.DEB.2.10.1603192012310.7678@sto>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox