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 9990.1518642809@sss.pgh.pa.us
Whole thread Raw
In response to Re: tapeblocks is uninitialized in logtape.c  (Jaime Casanova <jaime.casanova@2ndquadrant.com>)
List pgsql-hackers
Jaime Casanova <jaime.casanova@2ndquadrant.com> writes:
> 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)

Pushed with minor adjustments.  Notably, I didn't like the way you'd
fixed the issues in pgbench.c.  The issue seems to be that those compilers
note that coerceToBool doesn't initialize its output argument in all
code paths, and don't note that the callers only examine the output
if it returns true.  So I thought it was better to make coerceToBool
always set the output to something.  That way we aren't totally giving
up error detection in the callers: if there were a code path that used
the output variable without even having called coerceToBool, we'd still
hear about it.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: tapeblocks is uninitialized in logtape.c
Next
From: Tom Lane
Date:
Subject: Re: Cached/global query plans, autopreparation