diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-08-02 09:59:35 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-08-02 10:25:11 +0200 |
commit | 9fb855fe1ae04a147bd4cdaa571a1c9de5f03682 (patch) | |
tree | a8c5711e613dc4fd8fdfbda489c7530cc8402070 /src | |
parent | 63bef4df975cd8b0a3fee1384a80c569043a6d72 (diff) | |
download | postgresql-9fb855fe1ae04a147bd4cdaa571a1c9de5f03682.tar.gz postgresql-9fb855fe1ae04a147bd4cdaa571a1c9de5f03682.zip |
Include bison header files into implementation files
Before Bison 3.4, the generated parser implementation files run afoul
of -Wmissing-variable-declarations (in spite of commit ab61c40bfa2)
because declarations for yylval and possibly yylloc are missing. The
generated header files contain an extern declaration, but the
implementation files don't include the header files. Since Bison 3.4,
the generated implementation files automatically include the generated
header files, so then it works.
To make this work with older Bison versions as well, include the
generated header file from the .y file.
(With older Bison versions, the generated implementation file contains
effectively a copy of the header file pasted in, so including the
header file is redundant. But we know this works anyway because the
core grammar uses this arrangement already.)
Discussion: https://www.postgresql.org/message-id/flat/e0a62134-83da-4ba4-8cdb-ceb0111c95ce@eisentraut.org
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/bootstrap/bootparse.y | 1 | ||||
-rw-r--r-- | src/backend/replication/repl_gram.y | 1 | ||||
-rw-r--r-- | src/backend/replication/syncrep_gram.y | 2 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.header | 1 | ||||
-rw-r--r-- | src/pl/plpgsql/src/pl_gram.y | 1 | ||||
-rw-r--r-- | src/test/isolation/specparse.y | 1 |
6 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/bootstrap/bootparse.y b/src/backend/bootstrap/bootparse.y index 58e0878dc8d..73a7592fb71 100644 --- a/src/backend/bootstrap/bootparse.y +++ b/src/backend/bootstrap/bootparse.y @@ -32,6 +32,7 @@ #include "nodes/makefuncs.h" #include "utils/memutils.h" +#include "bootparse.h" /* silence -Wmissing-variable-declarations */ extern int boot_yychar; diff --git a/src/backend/replication/repl_gram.y b/src/backend/replication/repl_gram.y index c46ca395263..06daa954813 100644 --- a/src/backend/replication/repl_gram.y +++ b/src/backend/replication/repl_gram.y @@ -22,6 +22,7 @@ #include "replication/walsender.h" #include "replication/walsender_private.h" +#include "repl_gram.h" /* silence -Wmissing-variable-declarations */ extern int replication_yychar; diff --git a/src/backend/replication/syncrep_gram.y b/src/backend/replication/syncrep_gram.y index 5ce4f1bfe73..e4d9962226c 100644 --- a/src/backend/replication/syncrep_gram.y +++ b/src/backend/replication/syncrep_gram.y @@ -17,6 +17,8 @@ #include "nodes/pg_list.h" #include "replication/syncrep.h" +#include "syncrep_gram.h" + /* Result of parsing is returned in one of these two variables */ SyncRepConfigData *syncrep_parse_result; char *syncrep_parse_error_msg; diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header index 571b92f6434..3790a601d1a 100644 --- a/src/interfaces/ecpg/preproc/ecpg.header +++ b/src/interfaces/ecpg/preproc/ecpg.header @@ -5,6 +5,7 @@ #include "postgres_fe.h" #include "preproc_extern.h" +#include "preproc.h" #include "ecpg_config.h" #include <unistd.h> diff --git a/src/pl/plpgsql/src/pl_gram.y b/src/pl/plpgsql/src/pl_gram.y index 0671ff78722..8182ce28aa1 100644 --- a/src/pl/plpgsql/src/pl_gram.y +++ b/src/pl/plpgsql/src/pl_gram.y @@ -26,6 +26,7 @@ #include "plpgsql.h" +#include "pl_gram.h" /* silence -Wmissing-variable-declarations */ extern int plpgsql_yychar; diff --git a/src/test/isolation/specparse.y b/src/test/isolation/specparse.y index 282a7504556..788069d1ba5 100644 --- a/src/test/isolation/specparse.y +++ b/src/test/isolation/specparse.y @@ -13,6 +13,7 @@ #include "postgres_fe.h" #include "isolationtester.h" +#include "specparse.h" /* silence -Wmissing-variable-declarations */ extern int spec_yychar; |