mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 07:13:02 +00:00
allow modification on retrieved code_props.
The logic to compute the %printer or %destructor to used (i.e., a code_props) is implemented twice: one, of course, in symbol_code_props_get, and another time in symbol_check_defined to record the fact that a code_props is used (so that we can reported unused ones). Let the former use the latter. I would probably use "mutable" in C++ and keep these guys const, but this is C. And casting away constness triggers warnings. * src/scan-code.h, src/scan-code.l (code_props_none): Is not const. * src/symtab.h, src/symtab.c (symbol_code_props_get): The symbol is not const. (symbol_check_defined): Use it.
This commit is contained in:
@@ -181,8 +181,7 @@ void symbol_code_props_set (symbol *sym, code_props_type kind,
|
||||
/** Get the computed \c \%destructor or \c %printer for \c sym, which was
|
||||
initialized with \c code_props_none_init if there's no \c \%destructor or
|
||||
\c %printer. */
|
||||
code_props const *symbol_code_props_get (symbol const *sym,
|
||||
code_props_type kind);
|
||||
code_props *symbol_code_props_get (symbol *sym, code_props_type kind);
|
||||
|
||||
/** Set the \c precedence associated with \c sym.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user