Suppress "unused variable" warnings with older versions of flex.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 19 Feb 2017 18:04:30 +0000 (13:04 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 19 Feb 2017 18:04:30 +0000 (13:04 -0500)
commit65d508fd4decee4d5a54c1e7b93acd25d5e80556
treeda36765eb2d4088ec5e331f688d6ae29d44963c2
parenta3dc8e495b4967fe07086a700d115c89f4f0add0
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
src/Makefile.global.in
src/backend/parser/Makefile
src/bin/psql/Makefile
src/fe_utils/Makefile
src/tools/fix-flex-warning.pl [new file with mode: 0644]
src/tools/msvc/pgflex.pl