From nobody@FreeBSD.ORG Thu Jul 29 08:46:10 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 8E22C14E98; Thu, 29 Jul 1999 08:46:10 -0700 (PDT)
Message-Id: <19990729154610.8E22C14E98@hub.freebsd.org>
Date: Thu, 29 Jul 1999 08:46:10 -0700 (PDT)
From: vadim@gc.lviv.ua
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: Bison-1.25 bug in template
X-Send-Pr-Version: www-1.0

>Number:         12868
>Category:       gnu
>Synopsis:       Bison-1.25 bug in template
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 29 08:50:00 PDT 1999
>Closed-Date:    Fri Jul 30 10:23:58 PDT 1999
>Last-Modified:  Fri Jul 30 10:24:07 PDT 1999
>Originator:     Vadim Chekan
>Release:        FreeBSD-3.2
>Organization:
GC
>Environment:
FreeBSD gate.gc.lviv.ua 3.1-STABLE FreeBSD 3.1-STABLE #0: Sun May 23 16:49:39 EE
ST 1999     vadim@gate.gc.lviv.ua:/usr/src/sys/compile/GATE.3  i386
>Description:
In bison-1.25 which is in FreeBSD distribution in 
/usr/share/bison.simple is error which does impossible to compile *.y files
if YYPARSE_PARAM is defined
I get the error:
/usr/home/vadim/projects > bison.old test.y && cc -c test.tab.c
/usr/share/misc/bison.simple: In function `yyparse':
/usr/share/misc/bison.simple:219: number of arguments doesn't match prototype
/usr/share/misc/bison.simple:153: prototype declaration


>How-To-Repeat:
bison test.y && cc -c test.tab.c
===>Begin test.y
%{
#define YYPARSE_PARAM param
%}
%token T_STRING
%%
input:          T_STRING ;
%%
===>End test.y

>Fix:
--- bison.simple.old    Thu Jul 29 17:49:44 1999
+++ bison.simple.new    Thu Jul 29 17:50:11 1999
@@ -150,8 +150,12 @@

 /* Prevent warning if -Wstrict-prototypes.  */
 #ifdef __GNUC__
+#ifdef YYPARSE_PARAM
+int yyparse (void *);
+#else
 int yyparse (void);
 #endif
+#endif
 ^L
 #if __GNUC__ > 1               /* GNU C and GNU C++ define this.  */
 #define __yy_memcpy(TO,FROM,COUNT)     __builtin_memcpy(TO,FROM,COUNT)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: des 
Responsible-Changed-When: Fri Jul 30 00:46:22 PDT 1999 
Responsible-Changed-Why:  
Bison and Yacc are David's babies. 
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Fri Jul 30 10:23:58 PDT 1999 
State-Changed-Why:  
commited.  Thanks!! 
>Unformatted:
