On 13 February 2018 at 23:10, Tom Lane <t...@sss.pgh.pa.us> wrote: > Jaime Casanova <jaime.casan...@2ndquadrant.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
diff --git a/src/backend/access/transam/xloginsert.c b/src/backend/access/transam/xloginsert.c index de869e00ff..5bea073a2b 100644 *** a/src/backend/access/transam/xloginsert.c --- b/src/backend/access/transam/xloginsert.c *************** *** 584,590 **** XLogRecordAssemble(RmgrId rmid, uint8 info, if (include_image) { Page page = regbuf->page; ! uint16 compressed_len; /* * The page needs to be backed up, so calculate its hole length --- 584,590 ---- if (include_image) { Page page = regbuf->page; ! uint16 compressed_len = 0; /* * The page needs to be backed up, so calculate its hole length diff --git a/src/backend/catalog/objectaddressindex b4c2467710..3fa5b6e1db 100644 *** a/src/backend/catalog/objectaddress.c --- b/src/backend/catalog/objectaddress.c *************** *** 1576,1583 **** get_object_address_opf_member(ObjectType objtype, ObjectAddress address; ListCell *cell; List *copy; ! TypeName *typenames[2]; ! Oid typeoids[2]; int membernum; int i; --- 1576,1583 ---- ObjectAddress address; ListCell *cell; List *copy; ! TypeName *typenames[2] = { NULL }; ! Oid typeoids[2] = { InvalidOid }; int membernum; int i; diff --git a/src/backend/utils/sort/logtapindex 66bfcced8d..d6794bf3de 100644 *** a/src/backend/utils/sort/logtape.c --- b/src/backend/utils/sort/logtape.c *************** *** 411,417 **** ltsConcatWorkerTapes(LogicalTapeSet *lts, TapeShare *shared, SharedFileSet *fileset) { LogicalTape *lt = NULL; ! long tapeblocks; long nphysicalblocks = 0L; int i; --- 411,417 ---- SharedFileSet *fileset) { LogicalTape *lt = NULL; ! long tapeblocks = 0L; long nphysicalblocks = 0L; int i; diff --git a/src/bin/pgbench/pgbench.c index 31ea6ca06e..8b0c8bcaa8 100644 *** a/src/bin/pgbench/pgbench.c --- b/src/bin/pgbench/pgbench.c *************** *** 1614,1620 **** evalLazyFunc(TState *thread, CState *st, PgBenchFunction func, PgBenchExprLink *args, PgBenchValue *retval) { PgBenchValue a1, a2; ! bool ba1, ba2; Assert(isLazyFunc(func) && args != NULL && args->next != NULL); --- 1614,1620 ---- PgBenchFunction func, PgBenchExprLink *args, PgBenchValue *retval) { PgBenchValue a1, a2; ! bool ba1 = NULL, ba2 = NULL; Assert(isLazyFunc(func) && args != NULL && args->next != NULL); *************** *** 1935,1941 **** evalStandardFunc( /* logical operators */ case PGBENCH_NOT: { ! bool b; if (!coerceToBool(&vargs[0], &b)) return false; --- 1935,1941 ---- /* logical operators */ case PGBENCH_NOT: { ! bool b = NULL; if (!coerceToBool(&vargs[0], &b)) return false;