diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-02-19 13:04:30 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-02-19 13:04:30 -0500 |
commit | 65d508fd4decee4d5a54c1e7b93acd25d5e80556 (patch) | |
tree | da36765eb2d4088ec5e331f688d6ae29d44963c2 /src/backend | |
parent | a3dc8e495b4967fe07086a700d115c89f4f0add0 (diff) | |
download | postgresql-65d508fd4decee4d5a54c1e7b93acd25d5e80556.tar.gz postgresql-65d508fd4decee4d5a54c1e7b93acd25d5e80556.zip |
Suppress "unused variable" warnings with older versions of flex.
Versions of flex before 2.5.36 might generate code that results in an
"unused variable" warning, when using %option reentrant. Historically
we've worked around that by specifying -Wno-error, but that's an
unsatisfying solution. The official "fix" for this was just to insert a
dummy reference to the variable, so write a small perl script that edits
the generated C code similarly.
The MSVC side of this is untested, but the buildfarm should soon reveal
if I broke that.
Discussion: https://postgr.es/m/25456.1487437842@sss.pgh.pa.us
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/parser/Makefile | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/backend/parser/Makefile b/src/backend/parser/Makefile index fdd8485cec5..df9a9fbb35e 100644 --- a/src/backend/parser/Makefile +++ b/src/backend/parser/Makefile @@ -20,12 +20,6 @@ OBJS= analyze.o gram.o scan.o parser.o \ include $(top_srcdir)/src/backend/common.mk -# Latest flex causes warnings in this file. -ifeq ($(GCC),yes) -scan.o: CFLAGS += -Wno-error -endif - - # There is no correct way to write a rule that generates two files. # Rules with two targets don't have that meaning, they are merely # shorthand for two otherwise separate rules. To be safe for parallel @@ -41,6 +35,7 @@ gram.c: BISON_CHECK_CMD = $(PERL) $(srcdir)/check_keywords.pl $< $(top_srcdir)/s scan.c: FLEXFLAGS = -CF -p -p scan.c: FLEX_NO_BACKUP=yes +scan.c: FLEX_FIX_WARNING=yes # Force these dependencies to be known even without dependency info built: |