Re: tapeblocks is uninitialized in logtape.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: tapeblocks is uninitialized in logtape.c
Date
Msg-id 25790.1518641281@sss.pgh.pa.us
Whole thread Raw
In response to Re: tapeblocks is uninitialized in logtape.c  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: tapeblocks is uninitialized in logtape.c
List pgsql-hackers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 2/13/18 23:10, Tom Lane wrote:
>> Jaime Casanova <jaime.casanova@2ndquadrant.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?

> This warning comes from using -Og instead of -O2.

Actually, on looking closer, it's more likely got something to do with
whether or not you used --enable-cassert.  If the Assert at the top of
the function is disabled, then IMO a compiler that failed to complain
about this coding would be pretty damn broken.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: reorganizing partitioning code (was: Re: [HACKERS] path towardfaster partition pruning)
Next
From: Nikolay Shaplov
Date:
Subject: Re: [PATCH][PROPOSAL] Add enum releation option type