From owner-freebsd-ports@FreeBSD.ORG Mon Jan 23 08:44:25 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B25D916A41F for ; Mon, 23 Jan 2006 08:44:25 +0000 (GMT) (envelope-from eggert@CS.UCLA.EDU) Received: from kiwi.cs.ucla.edu (Kiwi.CS.UCLA.EDU [131.179.128.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CB6F43D46 for ; Mon, 23 Jan 2006 08:44:25 +0000 (GMT) (envelope-from eggert@CS.UCLA.EDU) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by kiwi.cs.ucla.edu (8.11.7p1+Sun/8.11.7/UCLACS-5.2) with ESMTP id k0N8i7H17058; Mon, 23 Jan 2006 00:44:07 -0800 (PST) Received: from eggert by penguin.cs.ucla.edu with local (Exim 4.50) id 1F0xJ1-0002dE-6L; Mon, 23 Jan 2006 00:44:07 -0800 To: Kris Kennaway References: <200601131825.SAA21164@sopwith.solgatos.com> <87r772obn8.fsf@penguin.cs.ucla.edu> <20060120211940.GA43031@xor.obsecurity.org> <87u0bymq7x.fsf@penguin.cs.ucla.edu> <20060122044224.GA81690@xor.obsecurity.org> From: Paul Eggert Date: Mon, 23 Jan 2006 00:44:07 -0800 In-Reply-To: <20060122044224.GA81690@xor.obsecurity.org> (Kris Kennaway's message of "Sat, 21 Jan 2006 23:42:24 -0500") Message-ID: <878xt7z63s.fsf@penguin.cs.ucla.edu> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd@sopwith.solgatos.com, bug-bison@gnu.org, freebsd-ports@freebsd.org, bison-patches@gnu.org Subject: Re: portability fix for bison-1.75 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2006 08:44:25 -0000 Kris Kennaway writes: > security/bro (ftp://ftp.ee.lbl.gov/) I installed the following patch into Bison CVS so that it will compile bro 0.8. This patch should appear in Bison 2.2, whenever that comes out. 2006-01-23 Paul Eggert Work around a bug in bro 0.8, which underparenthesizes its definition of YYLLOC_DEFAULT. * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize their arguments. * data/lalr1.cc: Likewise. * data/yacc.cc: Likewise. Index: data/glr.c =================================================================== RCS file: /cvsroot/bison/bison/data/glr.c,v retrieving revision 1.161 diff -p -u -r1.161 glr.c --- data/glr.c 22 Jan 2006 07:38:49 -0000 1.161 +++ data/glr.c 23 Jan 2006 08:31:33 -0000 @@ -923,7 +923,7 @@ yyuserAction (yyRuleNum yyn, int yyrhsle *yyvalp = yyval_default; else *yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval; - YYLLOC_DEFAULT (*yylocp, yyvsp - yyrhslen, yyrhslen); + YYLLOC_DEFAULT ((*yylocp), (yyvsp - yyrhslen), yyrhslen); ]b4_location_if([[ yystackp->yyerror_range[1].yystate.yyloc = *yylocp; ]])[ switch (yyn) @@ -2119,7 +2119,7 @@ yyrecoverSyntaxError (yyGLRStack* yystac yyGLRStackItem yyerror_range[3]; yyerror_range[1].yystate.yyloc = yys->yyloc; yyerror_range[2].yystate.yyloc = yylloc; - YYLLOC_DEFAULT (yys->yyloc, yyerror_range, 2);]])[ + YYLLOC_DEFAULT ((yys->yyloc), yyerror_range, 2);]])[ yydestruct ("Error: discarding", *yytokenp, &yylval]b4_location_if([, &yylloc])[]b4_user_args[); } @@ -2166,7 +2166,7 @@ yyrecoverSyntaxError (yyGLRStack* yystac /* Shift the error token having adjusted its location. */ YYLTYPE yyerrloc;]b4_location_if([[ yystackp->yyerror_range[2].yystate.yyloc = yylloc; - YYLLOC_DEFAULT (yyerrloc, yystackp->yyerror_range, 2);]])[ + YYLLOC_DEFAULT (yyerrloc, (yystackp->yyerror_range), 2);]])[ YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]], &yylval, &yyerrloc); yyglrShift (yystackp, 0, yytable[yyj], Index: data/lalr1.cc =================================================================== RCS file: /cvsroot/bison/bison/data/lalr1.cc,v retrieving revision 1.121 diff -p -u -r1.121 lalr1.cc --- data/lalr1.cc 22 Jan 2006 07:38:49 -0000 1.121 +++ data/lalr1.cc 23 Jan 2006 08:31:33 -0000 @@ -783,7 +783,7 @@ b4_error_verbose_if([, yytoken])[)); yyerror_range[1] = yylloc; // Using YYLLOC is tempting, but would change the location of // the look-ahead. YYLOC is available though. - YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2); + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); yysemantic_stack_.push (yylval); yylocation_stack_.push (yyloc); Index: data/yacc.c =================================================================== RCS file: /cvsroot/bison/bison/data/yacc.c,v retrieving revision 1.132 diff -p -u -r1.132 yacc.c --- data/yacc.c 23 Jan 2006 07:59:42 -0000 1.132 +++ data/yacc.c 23 Jan 2006 08:31:33 -0000 @@ -1262,7 +1262,7 @@ yyreduce: ]b4_location_if( [[ /* Default location. */ - YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);]])[ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);]])[ YY_REDUCE_PRINT (yyn); switch (yyn) { @@ -1427,7 +1427,7 @@ yyerrlab1: yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of the look-ahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2); + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc;]])[ /* Shift the error token. */