From ab61c40bfa2ba1887fee304b2ef5306a14a7248c Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 25 Jul 2024 09:26:08 +0200 Subject: 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 Discussion: https://www.postgresql.org/message-id/flat/e0a62134-83da-4ba4-8cdb-ceb0111c95ce@eisentraut.org --- src/interfaces/ecpg/preproc/ecpg.header | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/interfaces/ecpg') diff --git a/src/interfaces/ecpg/preproc/ecpg.header b/src/interfaces/ecpg/preproc/ecpg.header index 59502894256..571b92f6434 100644 --- a/src/interfaces/ecpg/preproc/ecpg.header +++ b/src/interfaces/ecpg/preproc/ecpg.header @@ -8,6 +8,10 @@ #include "ecpg_config.h" #include +/* silence -Wmissing-variable-declarations */ +extern int base_yychar; +extern int base_yynerrs; + /* Location tracking support --- simpler than bison's default */ #define YYLLOC_DEFAULT(Current, Rhs, N) \ do { \ -- cgit v1.2.3