bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison test version 1.875e bugs


From: Paul Eggert
Subject: Re: Bison test version 1.875e bugs
Date: Thu, 16 Dec 2004 12:43:32 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

address@hidden writes:

> it is optional, but good practice. at top of graph a line
> like ` title: "GNUBison-1.875e" ' would do and then the bison
> version is included also. no downsides at omitting the title.

Hmm, I'd rather not put in stuff that makes regression testing a pain.
Why is it good practice to put in a title?  What is the title normally
used for?

> only noticed it and would do:
> char *t;
> i=strtol(num,&t,10);
> if (*t) { printf("error at number conversion"); }

That doesn't solve the problem in general, though; it addresses only
the problem of $1foo, for example, and doesn't address either foo$1 or $$foo.

I installed the following patch instead.  Thanks for pointing out the
problem.

2004-12-16  Paul Eggert  <address@hidden>

        * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
        Parenthesize rhs to avoid obscure problems with mistakes like
        "foo$$bar = foo$1bar;".  Problem reported by twlevo at xs4all.
        * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
        b4_rhs_location): Likewise.
        * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
        b4_rhs_location): Likewise.

Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.86
diff -p -u -r1.86 glr.c
--- data/glr.c  16 Dec 2004 09:06:08 -0000      1.86
+++ data/glr.c  16 Dec 2004 20:38:44 -0000
@@ -103,7 +103,7 @@ m4_define([b4_lpure_formals],
 # --------------------
 # Expansion of $<TYPE>$.
 m4_define([b4_lhs_value],
-[(*yyvalp)[]m4_ifval([$1], [.$1])])
+[((*yyvalp)[]m4_ifval([$1], [.$1]))])
 
 
 # b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
@@ -111,7 +111,7 @@ m4_define([b4_lhs_value],
 # Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
 # symbols on RHS.
 m4_define([b4_rhs_value],
-[((yyGLRStackItem const *)yyvsp)@{YYFILL (m4_eval([$2 - 
$1]))@}.yystate.yysemantics.yysval[]m4_ifval([$3], [.$3])])
+[(((yyGLRStackItem const *)yyvsp)@{YYFILL (m4_eval([$2 - 
$1]))@}.yystate.yysemantics.yysval[]m4_ifval([$3], [.$3]))])
 
 
 
@@ -131,7 +131,7 @@ m4_define([b4_lhs_location],
 # Expansion of @NUM, where the current rule has RULE-LENGTH symbols
 # on RHS.
 m4_define([b4_rhs_location],
-[((yyGLRStackItem const *)yyvsp)@{YYFILL (m4_eval([$2 - $1]))@}.yystate.yyloc])
+[(((yyGLRStackItem const *)yyvsp)@{YYFILL (m4_eval([$2 - 
$1]))@}.yystate.yyloc)])
 
 # We do want M4 expansion after # for CPP macros.
 m4_changecom()
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.72
diff -p -u -r1.72 lalr1.cc
--- data/lalr1.cc       16 Dec 2004 14:39:42 -0000      1.72
+++ data/lalr1.cc       16 Dec 2004 20:38:44 -0000
@@ -35,7 +35,7 @@ m4_define_default([b4_parser_class_name]
 # --------------------
 # Expansion of $<TYPE>$.
 m4_define([b4_lhs_value],
-[yyval[]m4_ifval([$1], [.$1])])
+[(yyval[]m4_ifval([$1], [.$1]))])
 
 
 # b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
@@ -43,7 +43,7 @@ m4_define([b4_lhs_value],
 # Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
 # symbols on RHS.
 m4_define([b4_rhs_value],
address@hidden([$1 - $2])@}m4_ifval([$3], [.$3])])
+[(address@hidden([$1 - $2])@}m4_ifval([$3], [.$3]))])
 
 m4_define_default([b4_location_type], [Location])
 
@@ -51,7 +51,7 @@ m4_define_default([b4_location_type], [L
 # -----------------
 # Expansion of @$.
 m4_define([b4_lhs_location],
-[yyloc])
+[(yyloc)])
 
 
 # b4_rhs_location(RULE-LENGTH, NUM)
@@ -59,7 +59,7 @@ m4_define([b4_lhs_location],
 # Expansion of @NUM, where the current rule has RULE-LENGTH symbols
 # on RHS.
 m4_define([b4_rhs_location],
address@hidden([$1 - $2])@}])
+[(address@hidden([$1 - $2])@})])
 
 
 # b4_parse_param_decl
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.76
diff -p -u -r1.76 yacc.c
--- data/yacc.c 16 Dec 2004 09:06:08 -0000      1.76
+++ data/yacc.c 16 Dec 2004 20:38:44 -0000
@@ -93,7 +93,7 @@ m4_define([b4_int_type],
 # --------------------
 # Expansion of $<TYPE>$.
 m4_define([b4_lhs_value],
-[yyval[]m4_ifval([$1], [.$1])])
+[(yyval[]m4_ifval([$1], [.$1]))])
 
 
 # b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
@@ -101,7 +101,7 @@ m4_define([b4_lhs_value],
 # Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
 # symbols on RHS.
 m4_define([b4_rhs_value],
address@hidden([$2 - $1])@}m4_ifval([$3], [.$3])])
+[(address@hidden([$2 - $1])@}m4_ifval([$3], [.$3]))])
 
 
 
@@ -113,7 +113,7 @@ m4_define([b4_rhs_value],
 # -----------------
 # Expansion of @$.
 m4_define([b4_lhs_location],
-[yyloc])
+[(yyloc)])
 
 
 # b4_rhs_location(RULE-LENGTH, NUM)
@@ -121,7 +121,7 @@ m4_define([b4_lhs_location],
 # Expansion of @NUM, where the current rule has RULE-LENGTH symbols
 # on RHS.
 m4_define([b4_rhs_location],
address@hidden([$2 - $1])@}])
+[(address@hidden([$2 - $1])@})])
 
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]