Silence assorted "variable may be used uninitialized" warnings.
All of these are false positives, but in each case a fair amount of analysis is needed to see that, and it's not too surprising that not all compilers are smart enough. (In particular, in the logtape.c case, a compiler lacking the knowledge provided by the Assert would almost surely complain, so that this warning will be seen in any non-assert build.) Some of these are of long standing while others are pretty recent, but it only seems worth fixing them in HEAD. Jaime Casanova, tweaked a bit by me Discussion: https://postgr.es/m/CAJGNTeMcYAMJdPAom52dppLMtF-UnEZi0dooj==75OEv1EoBZA@mail.gmail.com
This commit is contained in:
parent
0c62356cc8
commit
9a725f7b5c
@ -584,7 +584,7 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
|
|||||||
if (include_image)
|
if (include_image)
|
||||||
{
|
{
|
||||||
Page page = regbuf->page;
|
Page page = regbuf->page;
|
||||||
uint16 compressed_len;
|
uint16 compressed_len = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The page needs to be backed up, so calculate its hole length
|
* The page needs to be backed up, so calculate its hole length
|
||||||
|
@ -1593,6 +1593,8 @@ get_object_address_opf_member(ObjectType objtype,
|
|||||||
famaddr = get_object_address_opcf(OBJECT_OPFAMILY, copy, false);
|
famaddr = get_object_address_opcf(OBJECT_OPFAMILY, copy, false);
|
||||||
|
|
||||||
/* find out left/right type names and OIDs */
|
/* find out left/right type names and OIDs */
|
||||||
|
typenames[0] = typenames[1] = NULL;
|
||||||
|
typeoids[0] = typeoids[1] = InvalidOid;
|
||||||
i = 0;
|
i = 0;
|
||||||
foreach(cell, lsecond(object))
|
foreach(cell, lsecond(object))
|
||||||
{
|
{
|
||||||
|
@ -411,7 +411,7 @@ ltsConcatWorkerTapes(LogicalTapeSet *lts, TapeShare *shared,
|
|||||||
SharedFileSet *fileset)
|
SharedFileSet *fileset)
|
||||||
{
|
{
|
||||||
LogicalTape *lt = NULL;
|
LogicalTape *lt = NULL;
|
||||||
long tapeblocks;
|
long tapeblocks = 0L;
|
||||||
long nphysicalblocks = 0L;
|
long nphysicalblocks = 0L;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -1495,6 +1495,7 @@ coerceToBool(PgBenchValue *pval, bool *bval)
|
|||||||
else /* NULL, INT or DOUBLE */
|
else /* NULL, INT or DOUBLE */
|
||||||
{
|
{
|
||||||
fprintf(stderr, "cannot coerce %s to boolean\n", valueTypeName(pval));
|
fprintf(stderr, "cannot coerce %s to boolean\n", valueTypeName(pval));
|
||||||
|
*bval = false; /* suppress uninitialized-variable warnings */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1725,9 +1726,9 @@ evalLazyFunc(TState *thread, CState *st,
|
|||||||
* which do not require lazy evaluation.
|
* which do not require lazy evaluation.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
evalStandardFunc(
|
evalStandardFunc(TState *thread, CState *st,
|
||||||
TState *thread, CState *st,
|
PgBenchFunction func, PgBenchExprLink *args,
|
||||||
PgBenchFunction func, PgBenchExprLink *args, PgBenchValue *retval)
|
PgBenchValue *retval)
|
||||||
{
|
{
|
||||||
/* evaluate all function arguments */
|
/* evaluate all function arguments */
|
||||||
int nargs = 0;
|
int nargs = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user