mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 21:03:04 +00:00
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:
committed by
Akim Demaille
parent
dda2c1adba
commit
b921d92fcb
@@ -51,6 +51,13 @@ typedef int symbol_number;
|
||||
|
||||
typedef struct symbol symbol;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
needed, /**< found but not "defined". */
|
||||
used, /**< used by %printer but not declared. */
|
||||
declared, /**< defined with %type or %token. */
|
||||
} status;
|
||||
|
||||
/* When extending this structure, be sure to complete
|
||||
symbol_check_alias_consistency. */
|
||||
struct symbol
|
||||
@@ -90,7 +97,7 @@ struct symbol
|
||||
symbol-string pair for an alias. */
|
||||
symbol *alias;
|
||||
symbol_class class;
|
||||
bool declared;
|
||||
status status;
|
||||
};
|
||||
|
||||
/** Undefined user number. */
|
||||
|
||||
Reference in New Issue
Block a user