Fix additional fallthrough warnings from clang

Clang warns if falling through to a case or default label that is
immediately followed by break, but GCC does
not (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432).  (MSVC also
warns about the equivalent code in C++.)

This is in preparation for enabling fallthrough warnings on Clang.

Reviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl>
Discussion: https://www.postgresql.org/message-id/flat/76a8efcd-925a-4eaf-bdd1-d972cd1a32ff%40eisentraut.org
This commit is contained in:
Peter Eisentraut 2026-02-23 07:37:50 +01:00
parent 308622edf1
commit 3a63b76571
8 changed files with 8 additions and 2 deletions

View file

@ -837,6 +837,7 @@ string2ean(const char *str, struct Node *escontext, ean13 *result,
case UPC:
buf[2] = '0';
valid = (valid && ((rcheck = checkdig(buf + 2, 13)) == check || magic));
break;
default:
break;
}

View file

@ -258,6 +258,7 @@ overexplain_per_node_hook(PlanState *planstate, List *ancestors,
overexplain_bitmapset("RTIs",
((Result *) plan)->relids,
es);
break;
default:
break;
}

View file

@ -1895,6 +1895,7 @@ PerformWalRecovery(void)
recoveryPausesHere(true);
/* drop into promote */
pg_fallthrough;
case RECOVERY_TARGET_ACTION_PROMOTE:
break;

View file

@ -430,9 +430,8 @@ heap2_decode(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
xlrec = (xl_heap_new_cid *) XLogRecGetData(buf->record);
SnapBuildProcessNewCid(builder, xid, buf->origptr, xlrec);
break;
}
break;
case XLOG_HEAP2_REWRITE:
/*

View file

@ -180,6 +180,7 @@ EndCommand(const QueryCompletion *qc, CommandDest dest, bool force_undecorated_o
len = BuildQueryCompletionString(completionTag, qc,
force_undecorated_output);
pq_putmessage(PqMsg_CommandComplete, completionTag, len + 1);
break;
case DestNone:
case DestDebug:

View file

@ -370,6 +370,7 @@ CNStoBIG5(unsigned short cns, unsigned char lc)
if (b1c4[i][1] == cns)
return b1c4[i][0];
}
break;
default:
break;
}

View file

@ -2333,6 +2333,7 @@ plpgsql_add_initdatums(int **varnos)
case PLPGSQL_DTYPE_VAR:
case PLPGSQL_DTYPE_REC:
(*varnos)[n++] = plpgsql_Datums[i]->dno;
break;
default:
break;

View file

@ -296,6 +296,7 @@ main(int argc, char **argv)
* done earlier.
*/
force_nl = false;
break;
case form_feed:
break;
case comment: