[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: generated code
From: |
Paul Eggert |
Subject: |
Re: generated code |
Date: |
Mon, 17 Jan 2005 01:36:32 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
address@hidden writes:
> there is no `default:' in the `switch(yyn)' at `yyreduce:'
> in the generated code, and using cvs development version.
> It gives warning message with `gcc -Wswitch-default'.
> solutions? should there be a `default:' statement?
I don't see why not. I installed this patch:
2005-01-17 Paul Eggert <address@hidden>
* data/glr.c (yyuserAction): Add "default: break;" case to pacify
gcc -Wswitch-default.
* data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
* data/yacc.c (yyparse): Likewise.
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.89
diff -p -u -r1.89 glr.c
--- data/glr.c 22 Dec 2004 21:19:47 -0000 1.89
+++ data/glr.c 17 Jan 2005 09:28:22 -0000
@@ -737,6 +737,7 @@ yyuserAction (yyRuleNum yyn, int yyrhsle
switch (yyn)
{
b4_actions
+ default: break;
}
return yyok;
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.81
diff -p -u -r1.81 lalr1.cc
--- data/lalr1.cc 8 Jan 2005 05:22:19 -0000 1.81
+++ data/lalr1.cc 17 Jan 2005 09:28:22 -0000
@@ -679,6 +679,7 @@ yyreduce:
switch (yyn_)
{
]b4_actions[
+ default: break;
}
]/* Line __line__ of lalr1.cc. */
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.80
diff -p -u -r1.80 yacc.c
--- data/yacc.c 8 Jan 2005 05:21:46 -0000 1.80
+++ data/yacc.c 17 Jan 2005 09:28:22 -0000
@@ -1033,6 +1033,7 @@ yyreduce:
switch (yyn)
]{
b4_actions
+ default: break;
}
/* Line __line__ of yacc.c. */