Re: tapeblocks is uninitialized in logtape.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: tapeblocks is uninitialized in logtape.c
Date: 2018-02-14 05:17:49
Message-ID: 7887.1518585469@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com> writes:
>> My compiler gives me this message
>> logtape.c: In function 'ltsConcatWorkerTapes':
>> logtape.c:462:48: warning: 'tapeblocks' may be used uninitialized in
>> this function [-Wmaybe-uninitialized]
>> lts->nBlocksAllocated = lt->offsetBlockNumber + tapeblocks;

> FWIW, I'm not seeing that. What compiler are you using exactly?
> (There are one or two other places where I see "may be used uninitialized"
> complaints from certain older gcc versions. Not sure how excited we
> should be about removing such warnings.)

Enlarging on that a bit ... I scraped the buildfarm logs to find all the
"may be used uninitialized" warnings currently being emitted by various
critters on HEAD. The full list is attachment 1.

Now, a large majority of those warnings are from coypu, locust, and
prairiedog, which are the three buildfarm members that use the broken
fallback implementations of the integer-ops-with-overflow-detection
functions in int.h, and I *will* continue to hound Andres until he accepts
that we need to fix those. There is a difference between "implementation
defined" and "undefined" behaviors, and those functions are on the wrong
side of that line.

However, if we exclude those three critters from the report, we get
attachment 2, which shows that there are exactly 8 places that are
being whined about by multiple buildfarm animals. Maybe it's worth
cleaning up those 8?

regards, tom lane

Attachment Content-Type Size
uninitialized-all text/plain 19.2 KB
uninitialized-some text/plain 3.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2018-02-14 05:56:48 Re: proposal: alternative psql commands quit and exit
Previous Message Michael Paquier 2018-02-14 04:42:08 Re: CALL stmt, ERROR: unrecognized node type: 113 bug