Re: tapeblocks is uninitialized in logtape.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: tapeblocks is uninitialized in logtape.c
Date: 2018-02-14 20:48:01
Message-ID: 25790.1518641281@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
> On 2/13/18 23:10, Tom Lane 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?

> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikolay Shaplov 2018-02-14 21:06:36 Re: [PATCH][PROPOSAL] Add enum releation option type
Previous Message Alvaro Herrera 2018-02-14 20:30:40 Re: reorganizing partitioning code (was: Re: [HACKERS] path toward faster partition pruning)