From 2e95f1f002bc3f0504dffa6d9ffed0dc914ecec1 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 25 Aug 2011 13:55:57 -0400 Subject: [PATCH] Add "%option warn" to all flex input files that lacked it. This is recommended in the flex manual, and there seems no good reason not to use it everywhere. --- contrib/cube/cubescan.l | 1 + contrib/seg/segscan.l | 1 + src/backend/bootstrap/bootscanner.l | 1 + src/backend/utils/misc/guc-file.l | 1 + src/bin/psql/psqlscan.l | 1 + src/interfaces/ecpg/preproc/pgc.l | 1 + src/test/isolation/specscanner.l | 5 +++-- 7 files changed, 9 insertions(+), 2 deletions(-) diff --git a/contrib/cube/cubescan.l b/contrib/cube/cubescan.l index eb71b11adf..c184930158 100644 --- a/contrib/cube/cubescan.l +++ b/contrib/cube/cubescan.l @@ -32,6 +32,7 @@ void cube_scanner_finish(void); %option noinput %option nounput %option noyywrap +%option warn %option prefix="cube_yy" diff --git a/contrib/seg/segscan.l b/contrib/seg/segscan.l index c2b5ca8789..e4feab39b3 100644 --- a/contrib/seg/segscan.l +++ b/contrib/seg/segscan.l @@ -30,6 +30,7 @@ void seg_scanner_finish(void); %option noinput %option nounput %option noyywrap +%option warn %option prefix="seg_yy" diff --git a/src/backend/bootstrap/bootscanner.l b/src/backend/bootstrap/bootscanner.l index fba020008f..f4230d93b1 100644 --- a/src/backend/bootstrap/bootscanner.l +++ b/src/backend/bootstrap/bootscanner.l @@ -55,6 +55,7 @@ static int yyline = 1; /* line number for error reporting */ %option noinput %option nounput %option noyywrap +%option warn %option prefix="boot_yy" diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l index 3e9b10328d..70abf40a28 100644 --- a/src/backend/utils/misc/guc-file.l +++ b/src/backend/utils/misc/guc-file.l @@ -51,6 +51,7 @@ static char *GUC_scanstr(const char *s); %option noinput %option nounput %option noyywrap +%option warn %option prefix="GUC_yy" diff --git a/src/bin/psql/psqlscan.l b/src/bin/psql/psqlscan.l index dfc6648e56..46141f7dda 100644 --- a/src/bin/psql/psqlscan.l +++ b/src/bin/psql/psqlscan.l @@ -132,6 +132,7 @@ static void escape_variable(bool as_ident); %option noinput %option nounput %option noyywrap +%option warn /* * All of the following definitions and rules should exactly match diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index 019b70bbaf..e4f55f8176 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -84,6 +84,7 @@ static struct _if_value %option nodefault %option noinput %option noyywrap +%option warn %option yylineno diff --git a/src/test/isolation/specscanner.l b/src/test/isolation/specscanner.l index 36e10e7678..77d863e3e6 100644 --- a/src/test/isolation/specscanner.l +++ b/src/test/isolation/specscanner.l @@ -15,7 +15,7 @@ static int yyline = 1; /* line number for error reporting */ static char litbuf[1024]; static int litbufpos = 0; -static void addlitchar(const char c); +static void addlitchar(char c); %} @@ -25,6 +25,7 @@ static void addlitchar(const char c); %option noinput %option nounput %option noyywrap +%option warn %option prefix="spec_yy" @@ -93,7 +94,7 @@ teardown { return(TEARDOWN); } %% static void -addlitchar(const char c) +addlitchar(char c) { if (litbufpos >= sizeof(litbuf) - 1) { -- GitLab