From: Paul Eggert Date: Fri, 9 Sep 2005 22:59:46 +0000 (+0000) Subject: * data/glr.c (YYCHK1): Do not assume YYE is in range. X-Git-Tag: BISON-2_1~15 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/127287e9c478d3b29f6671cab599131443443f95 * data/glr.c (YYCHK1): Do not assume YYE is in range. This avoids a diagnostic from gcc -Wswitch-enum. Problem reported by twlevo@xs4all.nl. --- diff --git a/ChangeLog b/ChangeLog index 2acf2644..4c71b0a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-09-09 Paul Eggert + * data/glr.c (YYCHK1): Do not assume YYE is in range. + This avoids a diagnostic from gcc -Wswitch-enum. + Problem reported by twlevo@xs4all.nl. + * doc/bison.texinfo: Don't use "filename", as per GNU coding standards. Use "file name" or "file" or "name", depending on the context. diff --git a/data/glr.c b/data/glr.c index 6faa86d3..37e05af7 100644 --- a/data/glr.c +++ b/data/glr.c @@ -2024,7 +2024,7 @@ yyrecoverSyntaxError (yyGLRStack* yystack, #define YYCHK1(YYE) \ do { \ switch (YYE) { \ - default: \ + case yyok: \ break; \ case yyabort: \ goto yyabortlab; \ @@ -2032,6 +2032,8 @@ yyrecoverSyntaxError (yyGLRStack* yystack, goto yyacceptlab; \ case yyerr: \ goto yyuser_error; \ + default: \ + goto yybuglab; \ } \ } while (0) @@ -2187,6 +2189,10 @@ b4_syncline([@oline@], [@ofile@])])dnl yyresult = 0; goto yyreturn; + yybuglab: + YYASSERT (yyfalse); + /* Fall through. */ + yyabortlab: yyresult = 1; goto yyreturn;