Re: tapeblocks is uninitialized in logtape.c

From: Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: tapeblocks is uninitialized in logtape.c
Date: 2018-02-14 17:06:45
Message-ID: CAJGNTePb20BNROnziQEdB_7d5m6_i-nW81NiouP1sz5xCU5maA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 13 February 2018 at 23:10, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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?
>

gcc version 6.3.0 20170516 (Debian 6.3.0-18)

> (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.)
>

i tried to fix the ones in your 2nd attachment, but i'm not real sure
about what value initialize the typename array in objectaddress.c and
the bool values in pgbench.c (both of them i initialized to NULL)

--
Jaime Casanova www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
fix_unused_vars.patch text/x-patch 2.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ankit Raj 2018-02-14 17:21:06 Re: Google Summer of Code 2018
Previous Message Andres Freund 2018-02-14 16:54:19 Re: Is this a bug?