Suppress "unused variable" warnings with older versions of flex.
Tom Lane <tgl@sss.pgh.pa.us>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/parser/Makefile | modified | +1 −6 |
| src/bin/psql/Makefile | modified | +1 −5 |
| src/fe_utils/Makefile | modified | +1 −5 |
| src/Makefile.global.in | modified | +1 −0 |
| src/tools/fix-flex-warning.pl | added | +65 −0 |
| src/tools/msvc/pgflex.pl | modified | +13 −7 |
Discussion
- Suppressing that pesky warning with older flex versions 3 messages · 2017-02-18 → 2017-02-19