summaryrefslogtreecommitdiff
path: root/src/backend/replication
diff options
context:
space:
mode:
authorPeter Eisentraut2024-07-25 07:26:08 +0000
committerPeter Eisentraut2024-07-25 07:26:08 +0000
commitab61c40bfa2ba1887fee304b2ef5306a14a7248c (patch)
treede7d28e05d1b329a46e8c3f3776605c1fce75e29 /src/backend/replication
parent32d3ed8165f821f6994c95230a9a4b2ff0ce9f12 (diff)
Add extern declarations for Bison global variables
This adds extern declarations for some global variables produced by Bison that are not already declared in its generated header file. This is a workaround to be able to add -Wmissing-variable-declarations to the global set of warning options in the near future. Another longer-term solution would be to convert these grammars to "pure" parsers in Bison, to avoid global variables altogether. Note that the core grammar is already pure, so this patch did not need to touch it. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/flat/e0a62134-83da-4ba4-8cdb-ceb0111c95ce@eisentraut.org
Diffstat (limited to 'src/backend/replication')
-rw-r--r--src/backend/replication/repl_gram.y5
-rw-r--r--src/backend/replication/syncrep_gram.y4
2 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/replication/repl_gram.y b/src/backend/replication/repl_gram.y
index 53780bbf297..c46ca395263 100644
--- a/src/backend/replication/repl_gram.y
+++ b/src/backend/replication/repl_gram.y
@@ -23,6 +23,11 @@
#include "replication/walsender_private.h"
+/* silence -Wmissing-variable-declarations */
+extern int replication_yychar;
+extern int replication_yynerrs;
+
+
/* Result of the parsing is returned here */
Node *replication_parse_result;
diff --git a/src/backend/replication/syncrep_gram.y b/src/backend/replication/syncrep_gram.y
index a14f63b6582..5ce4f1bfe73 100644
--- a/src/backend/replication/syncrep_gram.y
+++ b/src/backend/replication/syncrep_gram.y
@@ -24,6 +24,10 @@ char *syncrep_parse_error_msg;
static SyncRepConfigData *create_syncrep_config(const char *num_sync,
List *members, uint8 syncrep_method);
+/* silence -Wmissing-variable-declarations */
+extern int syncrep_yychar;
+extern int syncrep_yynerrs;
+
/*
* Bison doesn't allocate anything that needs to live across parser calls,
* so we can easily have it use palloc instead of malloc. This prevents