Pass -Wdangling-alias to Bison 3.5 or newer

`bison -Wall` enables all diagnostics except `-Wcounterexamples`
(added in 3.7; we already pass it), `-Wyacc` (which we do not need),
and `-Wdangling-alias` (added in 3.5).
This commit is contained in:
Rangi
2026-03-06 22:01:37 -05:00
parent af0505b4cd
commit 48d58ba095
2 changed files with 7 additions and 4 deletions

View File

@@ -14,9 +14,9 @@ fi
BISON_FLAGS="-Wall -Dlr.type=ielr"
# Set some optimization flags on versions that support them
# Set some flags on versions that support them
if [ "$BISON_MAJOR" -ge 4 ] || [ "$BISON_MAJOR" -eq 3 ] && [ "$BISON_MINOR" -ge 5 ]; then
BISON_FLAGS="$BISON_FLAGS -Dparse.lac=full -Dapi.token.raw=true"
BISON_FLAGS="$BISON_FLAGS -Dparse.lac=full -Dapi.token.raw=true -Wdangling-alias"
fi
if [ "$BISON_MAJOR" -ge 4 ] || [ "$BISON_MAJOR" -eq 3 ] && [ "$BISON_MINOR" -ge 6 ]; then
BISON_FLAGS="$BISON_FLAGS -Dparse.error=detailed"