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

Commitbf21612

Browse files
committed
Suppress more variable-set-but-not-used warnings from clang 15.
Mop up assorted set-but-not-used warnings in the back branches.This includes back-patching relevant fixes from commit152c9f7the rest of the way, but there are also several cases that did notappear in HEAD. Some of those we'd fixed in a retail way but notback-patched, and others I think just got rewritten out of existenceduring nearby refactoring.While here, also back-patchb1980f6 (PL/Tcl: Fix compiler warningswith Tcl 8.6) into 9.2, so that that branch compiles warning-freewith modern Tcl.Per project policy, this is a candidate for back-patching intoout-of-support branches: it suppresses annoying compiler warningsbut changes no behavior. Hence, back-patch all the way to 9.2.Discussion:https://postgr.es/m/514615.1663615243@sss.pgh.pa.us
1 parent8c8ee5c commitbf21612

File tree

7 files changed

+7
-19
lines changed

7 files changed

+7
-19
lines changed

‎contrib/hstore/crc32.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,10 @@ crc32_sz(char *buf, int size)
9595
{
9696
unsignedintcrc= ~((unsignedint)0);
9797
char*p;
98-
intlen,
99-
nr;
98+
intnr;
10099

101-
len=0;
102100
nr=size;
103-
for (len+=nr,p=buf;nr--;++p)
101+
for (p=buf;nr--;++p)
104102
_CRC32_(crc,*p);
105103
return ~crc;
106104
}

‎contrib/ltree/crc32.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,10 @@ ltree_crc32_sz(char *buf, int size)
103103
{
104104
unsignedintcrc= ~((unsignedint)0);
105105
char*p;
106-
intlen,
107-
nr;
106+
intnr;
108107

109-
len=0;
110108
nr=size;
111-
for (len+=nr,p=buf;nr--;++p)
109+
for (p=buf;nr--;++p)
112110
_CRC32_(crc,TOLOWER((unsignedint)*p));
113111
return ~crc;
114112
}

‎src/backend/access/gin/gindatapage.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,6 @@ dataSplitPage(GinBtree btree, Buffer lbuf, Buffer rbuf, OffsetNumber off, XLogRe
465465
Pagerpage=BufferGetPage(rbuf);
466466
SizepageSize=PageGetPageSize(lpage);
467467
SizefreeSpace;
468-
uint32nCopied=1;
469468

470469
/* these must be static so they can be returned to caller */
471470
staticginxlogSplitdata;
@@ -485,15 +484,13 @@ dataSplitPage(GinBtree btree, Buffer lbuf, Buffer rbuf, OffsetNumber off, XLogRe
485484

486485
if (GinPageIsLeaf(lpage)&&GinPageRightMost(lpage)&&off>GinPageGetOpaque(lpage)->maxoff)
487486
{
488-
nCopied=0;
489487
while (btree->curitem<btree->nitem&&
490488
maxoff*sizeof(ItemPointerData)<2* (freeSpace-sizeof(ItemPointerData)))
491489
{
492490
memcpy(vector+maxoff*sizeof(ItemPointerData),
493491
btree->items+btree->curitem,
494492
sizeof(ItemPointerData));
495493
maxoff++;
496-
nCopied++;
497494
btree->curitem++;
498495
}
499496
}

‎src/backend/optimizer/util/var.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,16 +651,13 @@ flatten_join_alias_vars_mutator(Node *node,
651651
RowExpr*rowexpr;
652652
List*fields=NIL;
653653
List*colnames=NIL;
654-
AttrNumberattnum;
655654
ListCell*lv;
656655
ListCell*ln;
657656

658-
attnum=0;
659657
Assert(list_length(rte->joinaliasvars)==list_length(rte->eref->colnames));
660658
forboth(lv,rte->joinaliasvars,ln,rte->eref->colnames)
661659
{
662660
newvar= (Node*)lfirst(lv);
663-
attnum++;
664661
/* Ignore dropped columns */
665662
if (newvar==NULL)
666663
continue;

‎src/backend/parser/gram.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
678678
stmtblock:stmtmulti
679679
{
680680
pg_yyget_extra(yyscanner)->parsetree = $1;
681+
(void)yynerrs;/* suppress compiler warning*/
681682
}
682683
;
683684

‎src/backend/utils/adt/array_typanalyze.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
216216
{
217217
ArrayAnalyzeExtraData*extra_data;
218218
intnum_mcelem;
219-
intnull_cnt=0;
220219
intnull_elem_cnt=0;
221220
intanalyzed_rows=0;
222221

@@ -321,8 +320,7 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
321320
value=fetchfunc(stats,array_no,&isnull);
322321
if (isnull)
323322
{
324-
/* array is null, just count that */
325-
null_cnt++;
323+
/* ignore arrays that are null overall */
326324
continue;
327325
}
328326

‎src/backend/utils/adt/varlena.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3403,7 +3403,6 @@ text_to_array_internal(PG_FUNCTION_ARGS)
34033403
* to search for occurrences of fldsep.
34043404
*/
34053405
TextPositionStatestate;
3406-
intfldnum;
34073406
intstart_posn;
34083407
intend_posn;
34093408
intchunk_len;
@@ -3443,7 +3442,7 @@ text_to_array_internal(PG_FUNCTION_ARGS)
34433442
/* start_ptr points to the start_posn'th character of inputstring */
34443443
start_ptr=VARDATA_ANY(inputstring);
34453444

3446-
for (fldnum=1;;fldnum++)/* field number is 1 based */
3445+
for (;;)
34473446
{
34483447
CHECK_FOR_INTERRUPTS();
34493448

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp