warnings: used but undeclared symbols are warnings

We used to raise an error if a symbol appears only in a %printer or
%destructor.  Make it a warning.

* src/symtab.h (status): New enum.
(symbol): Replace the binary "declared" with the three-state "status".
Adjust dependencies.
* src/symtab.c (symbol_check_defined): Needed symbols are an error,
whereas "used" are simply warnings.
* src/symlist.c (symbol_list_destructor_set, symbol_list_printer): Set
symbol status to 'used' when associated to destructors or printers.
* input.at (Undeclared symbols used for a printer or destructor): New.
This commit is contained in:
Victor Santet
2012-06-19 16:14:55 +02:00
committed by Akim Demaille
parent dda2c1adba
commit b921d92fcb
6 changed files with 66 additions and 10 deletions

12
NEWS
View File

@@ -2,6 +2,18 @@ GNU Bison NEWS
* Noteworthy changes in release ?.? (????-??-??) [?]
** Warnings about undeclared symbols
Bison used to raise an error for %printer and %destructor directives for
undefined symbols.
%printer {} symbol1
%destructor {} symbol2
%%
exp: "a";
This is now only a warning.
** Additional yylex/yyparse arguments
The new directive %param declare additional argument to both yylex