Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9a725f7

Browse files
committed
Silence assorted "variable may be used uninitialized" warnings.
All of these are false positives, but in each case a fair amount ofanalysis is needed to see that, and it's not too surprising that not allcompilers are smart enough. (In particular, in the logtape.c case, acompiler lacking the knowledge provided by the Assert would almost surelycomplain, 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 meDiscussion:https://postgr.es/m/CAJGNTeMcYAMJdPAom52dppLMtF-UnEZi0dooj==75OEv1EoBZA@mail.gmail.com
1 parent0c62356 commit9a725f7

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

‎src/backend/access/transam/xloginsert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ XLogRecordAssemble(RmgrId rmid, uint8 info,
584584
if (include_image)
585585
{
586586
Pagepage=regbuf->page;
587-
uint16compressed_len;
587+
uint16compressed_len=0;
588588

589589
/*
590590
* The page needs to be backed up, so calculate its hole length

‎src/backend/catalog/objectaddress.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,8 @@ get_object_address_opf_member(ObjectType objtype,
15931593
famaddr=get_object_address_opcf(OBJECT_OPFAMILY,copy, false);
15941594

15951595
/* find out left/right type names and OIDs */
1596+
typenames[0]=typenames[1]=NULL;
1597+
typeoids[0]=typeoids[1]=InvalidOid;
15961598
i=0;
15971599
foreach(cell,lsecond(object))
15981600
{

‎src/backend/utils/sort/logtape.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ ltsConcatWorkerTapes(LogicalTapeSet *lts, TapeShare *shared,
411411
SharedFileSet*fileset)
412412
{
413413
LogicalTape*lt=NULL;
414-
longtapeblocks;
414+
longtapeblocks=0L;
415415
longnphysicalblocks=0L;
416416
inti;
417417

‎src/bin/pgbench/pgbench.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,6 +1495,7 @@ coerceToBool(PgBenchValue *pval, bool *bval)
14951495
else/* NULL, INT or DOUBLE */
14961496
{
14971497
fprintf(stderr,"cannot coerce %s to boolean\n",valueTypeName(pval));
1498+
*bval= false;/* suppress uninitialized-variable warnings */
14981499
return false;
14991500
}
15001501
}
@@ -1725,9 +1726,9 @@ evalLazyFunc(TState *thread, CState *st,
17251726
* which do not require lazy evaluation.
17261727
*/
17271728
staticbool
1728-
evalStandardFunc(
1729-
TState*thread,CState*st,
1730-
PgBenchFunctionfunc,PgBenchExprLink*args,PgBenchValue*retval)
1729+
evalStandardFunc(TState*thread,CState*st,
1730+
PgBenchFunctionfunc,PgBenchExprLink*args,
1731+
PgBenchValue*retval)
17311732
{
17321733
/* evaluate all function arguments */
17331734
intnargs=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp