Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab61c40

Browse files
committed
Add extern declarations for Bison global variables
This adds extern declarations for some global variables produced byBison that are not already declared in its generated header file.This is a workaround to be able to add -Wmissing-variable-declarationsto 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. Notethat the core grammar is already pure, so this patch did not need totouch it.Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://www.postgresql.org/message-id/flat/e0a62134-83da-4ba4-8cdb-ceb0111c95ce@eisentraut.org
1 parent32d3ed8 commitab61c40

File tree

8 files changed

+33
-0
lines changed

8 files changed

+33
-0
lines changed

‎contrib/cube/cubeparse.y

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
#include"utils/float.h"
1212
#include"varatt.h"
1313

14+
/* silence -Wmissing-variable-declarations*/
15+
externint cube_yychar;
16+
externint cube_yynerrs;
17+
1418
/* All grammar constructs return strings*/
1519
#defineYYSTYPEchar *
1620

‎contrib/seg/segparse.y

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
#include"segdata.h"
1515

16+
/* silence -Wmissing-variable-declarations*/
17+
externint seg_yychar;
18+
externint seg_yynerrs;
19+
1620
/*
1721
* Bison doesn't allocate anything that needs to live across parser calls,
1822
* so we can easily have it use palloc instead of malloc. This prevents

‎src/backend/bootstrap/bootparse.y

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
#include"utils/memutils.h"
3434

3535

36+
/* silence -Wmissing-variable-declarations*/
37+
externint boot_yychar;
38+
externint boot_yynerrs;
39+
40+
3641
/*
3742
* Bison doesn't allocate anything that needs to live across parser calls,
3843
* so we can easily have it use palloc instead of malloc. This prevents

‎src/backend/replication/repl_gram.y

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#include"replication/walsender_private.h"
2424

2525

26+
/* silence -Wmissing-variable-declarations*/
27+
externint replication_yychar;
28+
externint replication_yynerrs;
29+
30+
2631
/* Result of the parsing is returned here*/
2732
Node *replication_parse_result;
2833

‎src/backend/replication/syncrep_gram.y

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ char *syncrep_parse_error_msg;
2424
static SyncRepConfigData *create_syncrep_config(constchar *num_sync,
2525
List *members, uint8 syncrep_method);
2626

27+
/* silence -Wmissing-variable-declarations*/
28+
externint syncrep_yychar;
29+
externint syncrep_yynerrs;
30+
2731
/*
2832
* Bison doesn't allocate anything that needs to live across parser calls,
2933
* so we can easily have it use palloc instead of malloc. This prevents

‎src/interfaces/ecpg/preproc/ecpg.header

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
#include "ecpg_config.h"
99
#include <unistd.h>
1010

11+
/* silence -Wmissing-variable-declarations */
12+
extern int base_yychar;
13+
extern int base_yynerrs;
14+
1115
/* Location tracking support --- simpler than bison's default */
1216
#define YYLLOC_DEFAULT(Current, Rhs, N) \
1317
do { \

‎src/pl/plpgsql/src/pl_gram.y

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
#include"plpgsql.h"
2828

2929

30+
/* silence -Wmissing-variable-declarations*/
31+
externint plpgsql_yychar;
32+
externint plpgsql_yynerrs;
33+
3034
/* Location tracking support --- simpler than bison's default*/
3135
#defineYYLLOC_DEFAULT(Current, Rhs, N) \
3236
do { \

‎src/test/isolation/specparse.y

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
#include"isolationtester.h"
1616

17+
/* silence -Wmissing-variable-declarations*/
18+
externint spec_yychar;
19+
externint spec_yynerrs;
1720

1821
TestSpecparseresult;/* result of parsing is left here*/
1922

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp