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

Commit9fb855f

Browse files
committed
Include bison header files into implementation files
Before Bison 3.4, the generated parser implementation files run afoulof -Wmissing-variable-declarations (in spite of commitab61c40)because declarations for yylval and possibly yylloc are missing. Thegenerated header files contain an extern declaration, but theimplementation files don't include the header files. Since Bison 3.4,the generated implementation files automatically include the generatedheader files, so then it works.To make this work with older Bison versions as well, include thegenerated header file from the .y file.(With older Bison versions, the generated implementation file containseffectively a copy of the header file pasted in, so including theheader file is redundant. But we know this works anyway because thecore grammar uses this arrangement already.)Discussion:https://www.postgresql.org/message-id/flat/e0a62134-83da-4ba4-8cdb-ceb0111c95ce@eisentraut.org
1 parent63bef4d commit9fb855f

File tree

8 files changed

+13
-3
lines changed

8 files changed

+13
-3
lines changed

‎contrib/cube/cubeparse.y

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
#include"utils/float.h"
1212
#include"varatt.h"
1313

14+
/* All grammar constructs return strings*/
15+
#defineYYSTYPEchar *
16+
17+
#include"cubeparse.h"
18+
1419
/* silence -Wmissing-variable-declarations*/
1520
externint cube_yychar;
1621
externint cube_yynerrs;
1722

18-
/* All grammar constructs return strings*/
19-
#defineYYSTYPEchar *
20-
2123
/*
2224
* Bison doesn't allocate anything that needs to live across parser calls,
2325
* so we can easily have it use palloc instead of malloc. This prevents

‎contrib/seg/segparse.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include"utils/float.h"
1313

1414
#include"segdata.h"
15+
#include"segparse.h"
1516

1617
/* silence -Wmissing-variable-declarations*/
1718
externint seg_yychar;

‎src/backend/bootstrap/bootparse.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include"nodes/makefuncs.h"
3333
#include"utils/memutils.h"
3434

35+
#include"bootparse.h"
3536

3637
/* silence -Wmissing-variable-declarations*/
3738
externint boot_yychar;

‎src/backend/replication/repl_gram.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include"replication/walsender.h"
2323
#include"replication/walsender_private.h"
2424

25+
#include"repl_gram.h"
2526

2627
/* silence -Wmissing-variable-declarations*/
2728
externint replication_yychar;

‎src/backend/replication/syncrep_gram.y

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include"nodes/pg_list.h"
1818
#include"replication/syncrep.h"
1919

20+
#include"syncrep_gram.h"
21+
2022
/* Result of parsing is returned in one of these two variables*/
2123
SyncRepConfigData *syncrep_parse_result;
2224
char *syncrep_parse_error_msg;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "postgres_fe.h"
66

77
#include "preproc_extern.h"
8+
#include "preproc.h"
89
#include "ecpg_config.h"
910
#include <unistd.h>
1011

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include"plpgsql.h"
2828

29+
#include"pl_gram.h"
2930

3031
/* silence -Wmissing-variable-declarations*/
3132
externint plpgsql_yychar;

‎src/test/isolation/specparse.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include"postgres_fe.h"
1414

1515
#include"isolationtester.h"
16+
#include"specparse.h"
1617

1718
/* silence -Wmissing-variable-declarations*/
1819
externint spec_yychar;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp