fixits: suggest running --update if there are fixits

* src/fixits.h, src/fixits.c (fixits_empty): New.
* src/complain.c (deprecated_directive): Register the Wdeprecated
fixits only if -Wdeprecated was enabled, so that we don't apply
updates if the user didn't ask for them.
* src/main.c (main): If there were fixits, issue a warning suggesting
running with --update.
Free uniqstrs after the fixits, since the latter use the former.
* tests/headers.at, tests/input.at: Update expectations.
This commit is contained in:
Akim Demaille
2019-01-15 21:00:41 +01:00
parent b7e0d3131d
commit 169fe80c7f
6 changed files with 35 additions and 8 deletions

View File

@@ -86,6 +86,7 @@ exp: %empty;
AT_BISON_CHECK([--defines -o input.c input.y], [], [],
[[input.y:11.1-18: warning: deprecated directive: '%name-prefix "my_"', use '%define api.prefix {my_}' [-Wdeprecated]
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
]])
# YYLTYPE should be defined, and MY_LLOC declared.