From 3d76b07def2060a412e81f8ae2925b3cff795d40 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 14 Nov 2001 14:57:44 +0000 Subject: [PATCH] * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be defined only if yyoverflow is defined, to avoid `warning: unused variable `yyvs1''. Reported by The Test Suite. --- ChangeLog | 7 +++++++ src/bison.simple | 52 +++++++++++++++++++++++------------------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 892cc343..b37a3a5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-11-14 Akim Demaille + + * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be + defined only if yyoverflow is defined, to avoid `warning: unused + variable `yyvs1''. + Reported by The Test Suite. + 2001-11-14 Akim Demaille * src/print.c: Include reduce.h. diff --git a/src/bison.simple b/src/bison.simple index d08be3ff..d5a6089b 100644 --- a/src/bison.simple +++ b/src/bison.simple @@ -545,40 +545,38 @@ yyparse (YYPARSE_PARAM_ARG) if (yyssp >= yyss + yystacksize - 1) { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into memory. - */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#if YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - /* Get the current used size of the three stacks, in elements. */ int size = yyssp - yyss + 1; #ifdef yyoverflow - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. */ + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. */ # if YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); + YYLTYPE *yyls1 = yyls; + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow ("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); + yyls = yyls1; # else - yyoverflow ("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -# endif - - yyss = yyss1; yyvs = yyvs1; -# if YYLSP_NEEDED - yyls = yyls1; + yyoverflow ("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); # endif + yyss = yyss1; + yyvs = yyvs1; + } #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) -- 2.45.2