[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/8] yacc.c: simplify initialization
From: |
Akim Demaille |
Subject: |
[PATCH 1/8] yacc.c: simplify initialization |
Date: |
Tue, 6 Nov 2012 17:47:10 +0100 |
* data/yacc.c: Fuse the initializations of yyssp, yyss and the like.
Remove an obsolete comment: we do initialize these initial stack
members (in some cases).
---
data/yacc.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/data/yacc.c b/data/yacc.c
index 5d68bd4..77f86ec 100644
--- a/data/yacc.c
+++ b/data/yacc.c
@@ -1558,9 +1558,9 @@ b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
goto yyread_pushed_token;
}]])[
- yyss = yyssa;
- yyvs = yyvsa;]b4_locations_if([[
- yyls = yylsa;]])[
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;]b4_locations_if([[
+ yylsp = yyls = yylsa;]])[
yystacksize = YYINITDEPTH;]b4_lac_if([[
yyes = yyesa;
@@ -1574,14 +1574,6 @@ b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
- yyssp = yyss;
- yyvsp = yyvs;]b4_locations_if([[
- yylsp = yyls;]])[
]m4_ifdef([b4_initial_action],[
b4_dollar_pushdef([m4_define([b4_dollar_dollar_used])yylval], [],
[m4_define([b4_at_dollar_used])yylloc])dnl
--
1.8.0
- [PATCH 0/8] {branch-2.6} more fixes for -Wuninitialized warnings, Akim Demaille, 2012/11/06
- [PATCH 3/8] glr.cc, yacc.c: initialize yylloc properly, Akim Demaille, 2012/11/06
- [PATCH 4/8] yacc.c: also disable -Wuninitialized., Akim Demaille, 2012/11/06
- [PATCH 6/8] lalr1.cc: always initialize yylval., Akim Demaille, 2012/11/06
- [PATCH 2/8] yacc.c, glr.c: a better YY_LOCATION_PRINT, Akim Demaille, 2012/11/06
- [PATCH 8/8] tests: calc: modernize the use of locations, Akim Demaille, 2012/11/06
- [PATCH 1/8] yacc.c: simplify initialization,
Akim Demaille <=
- [PATCH 5/8] tests: check that C and C++ objects can be linked together., Akim Demaille, 2012/11/06
- [PATCH 7/8] tests: remove useless location initializations, Akim Demaille, 2012/11/06