Remove COMMAND_TAG_NEXTTAG from enum CommandTag.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 13 May 2024 17:52:17 +0000 (13:52 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 13 May 2024 17:52:17 +0000 (13:52 -0400)
COMMAND_TAG_NEXTTAG isn't really a valid command tag.  Declaring it
as if it were one prompts complaints from Coverity and perhaps other
static analyzers.  Our only use of it is in an entirely-unnecessary
array sizing declaration, so let's just drop it.

Ranier Vilela

Discussion: https://postgr.es/m/CAEudQAoY0xrKuTAX7W10zsjjUpKBPFRtdCyScb3Z0FB2v6HNmQ@mail.gmail.com

src/backend/tcop/cmdtag.c
src/include/tcop/cmdtag.h

index 68689b3e0d9cef80d219080e8872e4873fc61e47..0870064fdd83b0001a76ddbd6bf39a5e1db29248 100644 (file)
@@ -30,7 +30,7 @@ typedef struct CommandTagBehavior
 #define PG_CMDTAG(tag, name, evtrgok, rwrok, rowcnt) \
    { name, (uint8) (sizeof(name) - 1), evtrgok, rwrok, rowcnt },
 
-static const CommandTagBehavior tag_behavior[COMMAND_TAG_NEXTTAG] = {
+static const CommandTagBehavior tag_behavior[] = {
 #include "tcop/cmdtaglist.h"
 };
 
index da210e54fa8cfe4a9f2fade87b23e8c459140013..23c99d7eca654aa810b776a3d69e7271b201fab6 100644 (file)
@@ -22,7 +22,6 @@
 typedef enum CommandTag
 {
 #include "tcop/cmdtaglist.h"
-   COMMAND_TAG_NEXTTAG
 } CommandTag;
 
 #undef PG_CMDTAG