Re: pgsql: Add infrastructure to save and restore GUC values. - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Add infrastructure to save and restore GUC values.
Date
Msg-id 12877.1416946843@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Add infrastructure to save and restore GUC values.  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: pgsql: Add infrastructure to save and restore GUC values.
List pgsql-committers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> On 11/25/2014 12:17 AM, Robert Haas wrote:
>> Add infrastructure to save and restore GUC values.

> guc.c: In function ‘EstimateGUCStateSpace’:
> guc.c:8506:7: warning: ‘valsize’ may be used uninitialized in this
> function [-Wmaybe-uninitialized]
>    Size  valsize;
>         ^
> guc.c: In function ‘SerializeGUCState’:
> guc.c:8762:56: warning: ‘i_role’ may be used uninitialized in this
> function [-Wmaybe-uninitialized]
>    serialize_variable(&curptr, &bytes_left, guc_variables[i_role]);
>                                                          ^

I fixed the latter (my compiler was unhappy about it though not about
the former).  I'm not sure whether Robert would prefer to fix
the former by adding a useless initialization or by adding a default:
to the switch.  Personally I'd lean towards the initialization, though,
as a default: would suppress warnings about errors-of-omission if we
ever add more switch cases.

            regards, tom lane


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix uninitialized-variable warning.
Next
From: Simon Riggs
Date:
Subject: pgsql: Remove extraneous SGML tag