yacc.c: fix warnings about integral types

Reported by Derek Clegg.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00018.html

Rather than adding casts, we should be more careful with types.  For
instance yystate should be a yytype_int16.  But currently we can't: it
is also used sometimes for storing other things that state numbers.

* data/yacc.c (yyparse): Add missing casts.
This commit is contained in:
Akim Demaille
2018-10-22 14:30:41 +02:00
parent ae1e65a285
commit 7a45fc35bf
2 changed files with 18 additions and 9 deletions

10
TODO
View File

@@ -1,10 +1,20 @@
* Short term
** yacc.c
Now that ylwrap is fixed, we should include foo.tab.h from foo.tab.c rather
than duplicating it.
** C++
Move to int everywhere instead of unsigned? stack_size, etc. The parser
itself uses int (for yylen for instance), yet stack is based on size_t.
Maybe locations should also move to ints.
** C
Introduce state_type rather than spreading yytype_int16 everywhere?
** glr.c
yyspaceLeft should probably be a pointer diff.
** Graphviz display code thoughts
The code for the --graph option is over two files: print_graph, and
graphviz. This is because Bison used to also produce VCG graphs, but since