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

Commit3c5a33a

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 parent7d5d3f0 commit3c5a33a

File tree

7 files changed

+11
-16
lines changed

7 files changed

+11
-16
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/transam/xlog.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,9 @@ AdvanceXLInsertBuffer(XLogRecPtr upto, bool opportunistic)
21592159
XLogRecPtrNewPageEndPtr=InvalidXLogRecPtr;
21602160
XLogRecPtrNewPageBeginPtr;
21612161
XLogPageHeaderNewPage;
2162+
#ifdefWAL_DEBUG
21622163
intnpages=0;
2164+
#endif
21632165

21642166
LWLockAcquire(WALBufMappingLock,LW_EXCLUSIVE);
21652167

@@ -2306,7 +2308,9 @@ AdvanceXLInsertBuffer(XLogRecPtr upto, bool opportunistic)
23062308

23072309
XLogCtl->InitializedUpTo=NewPageEndPtr;
23082310

2311+
#ifdefWAL_DEBUG
23092312
npages++;
2313+
#endif
23102314
}
23112315
LWLockRelease(WALBufMappingLock);
23122316

‎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
@@ -690,6 +690,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
690690
stmtblock:stmtmulti
691691
{
692692
pg_yyget_extra(yyscanner)->parsetree = $1;
693+
(void)yynerrs;/* suppress compiler warning*/
693694
}
694695
;
695696

‎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