diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2020-12-02 21:39:26 +0100 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-12-03 06:21:53 +0100 |
commit | 24233748ecd1dfaae212224fb269531eca50ad37 (patch) | |
tree | 714d1326cc0c3f23cdc4b2b9cfaaf4be79b338bf /src/parse-gram.c | |
parent | 9840e5b621be661c2f7cd593a8bcb910447531da (diff) | |
download | bison-24233748ecd1dfaae212224fb269531eca50ad37.tar.gz |
tables: avoid warnings and save bits
The yydefgoto table uses -1 as an invalid for an impossible case (we
never use yydefgoto[0], since it corresponds to the reduction to
$accept, which never happens). Since yydefgoto is a table of state
numbers, this -1 forces a signed type uselessly, which (1) might
trigger compiler warnings when storing a value from yydefgoto into a
state number (nonnegative), and (2) wastes bits which might result in
using a int16 where a uint8 suffices.
Reported by Jot Dot <jotdot@shaw.ca>.
https://lists.gnu.org/r/bug-bison/2020-11/msg00027.html
* src/tables.c (default_goto): Use 0 rather than -1 as invalid value.
* tests/regression.at: Adjust.
Diffstat (limited to 'src/parse-gram.c')
-rw-r--r-- | src/parse-gram.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parse-gram.c b/src/parse-gram.c index adda86af..83f7d4a9 100644 --- a/src/parse-gram.c +++ b/src/parse-gram.c @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.7.3.118-d0ea7-dirty. */ +/* A Bison parser, made by GNU Bison 3.7.4.133-f40c-dirty. */ /* Bison implementation for Yacc-like parsers in C @@ -46,10 +46,10 @@ USER NAME SPACE" below. */ /* Identify Bison output, and Bison version. */ -#define YYBISON 30703 +#define YYBISON 30704 /* Bison version string. */ -#define YYBISON_VERSION "3.7.3.118-d0ea7-dirty" +#define YYBISON_VERSION "3.7.4.133-f40c-dirty" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -799,9 +799,9 @@ static const yytype_int16 yypgoto[] = }; /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +static const yytype_uint8 yydefgoto[] = { - -1, 1, 2, 43, 81, 115, 76, 45, 83, 46, + 0, 1, 2, 43, 81, 115, 76, 45, 83, 46, 50, 49, 51, 47, 60, 158, 120, 121, 122, 96, 92, 93, 94, 128, 142, 86, 87, 88, 99, 70, 77, 78, 79, 136, 146, 147, 113, 55, 105, 71, |