diff options
author | Peter Eisentraut | 2024-07-25 07:26:08 +0000 |
---|---|---|
committer | Peter Eisentraut | 2024-07-25 07:26:08 +0000 |
commit | ab61c40bfa2ba1887fee304b2ef5306a14a7248c (patch) | |
tree | de7d28e05d1b329a46e8c3f3776605c1fce75e29 /contrib | |
parent | 32d3ed8165f821f6994c95230a9a4b2ff0ce9f12 (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 'contrib')
-rw-r--r-- | contrib/cube/cubeparse.y | 4 | ||||
-rw-r--r-- | contrib/seg/segparse.y | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/contrib/cube/cubeparse.y b/contrib/cube/cubeparse.y index b39fbe63e6b..fd56d0e1628 100644 --- a/contrib/cube/cubeparse.y +++ b/contrib/cube/cubeparse.y @@ -11,6 +11,10 @@ #include "utils/float.h" #include "varatt.h" +/* silence -Wmissing-variable-declarations */ +extern int cube_yychar; +extern int cube_yynerrs; + /* All grammar constructs return strings */ #define YYSTYPE char * diff --git a/contrib/seg/segparse.y b/contrib/seg/segparse.y index bf759dbbd84..729d4b6390b 100644 --- a/contrib/seg/segparse.y +++ b/contrib/seg/segparse.y @@ -13,6 +13,10 @@ #include "segdata.h" +/* silence -Wmissing-variable-declarations */ +extern int seg_yychar; +extern int seg_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 |