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

Commitd63d486

Browse files
committed
Remove assertions that some compiler say are tautological
To avoid the compiler warnings: launch_backend.c:211:39: warning: comparison of constant 16 with expression of type 'BackendType' (aka 'enum BackendType') is always true [-Wtautological-constant-out-of-range-compare] launch_backend.c:233:39: warning: comparison of constant 16 with expression of type 'BackendType' (aka 'enum BackendType') is always true [-Wtautological-constant-out-of-range-compare]The point of the assertions was to fail more explicitly if someoneadds a new BackendType to the end of the enum, but forgets to add itto the child_process_kinds array. It was a pretty weak assertion tobegin with, because it wouldn't catch if you added a new BackendTypein the middle of the enum. So let's just remove it.Per buildfarm member ayu and a few others, spotted by Tom Lane.Discussion:https://www.postgresql.org/message-id/4119680.1710913067@sss.pgh.pa.us
1 parent9578393 commitd63d486

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎src/backend/postmaster/launch_backend.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ child_process_kind child_process_kinds[] = {
208208
constchar*
209209
PostmasterChildName(BackendTypechild_type)
210210
{
211-
Assert(child_type >=0&&child_type<lengthof(child_process_kinds));
212211
returnchild_process_kinds[child_type].name;
213212
}
214213

@@ -230,7 +229,6 @@ postmaster_child_launch(BackendType child_type,
230229
{
231230
pid_tpid;
232231

233-
Assert(child_type >=0&&child_type<lengthof(child_process_kinds));
234232
Assert(IsPostmasterEnvironment&& !IsUnderPostmaster);
235233

236234
#ifdefEXEC_BACKEND

‎src/include/miscadmin.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@ extern void SwitchBackToLocalLatch(void);
326326

327327
/*
328328
* MyBackendType indicates what kind of a backend this is.
329+
*
330+
* If you add entries, please also update the child_process_kinds array in
331+
* launch_backend.c.
329332
*/
330333
typedefenumBackendType
331334
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp