bootstrap/10452: Make gengtype-yacc.y buildable with FreeBSD yacc
Tue Apr 22 14:16:00 GMT 2003

>Number:         10452
>Category:       bootstrap
>Synopsis:       Make gengtype-yacc.y compatible with stock FreeBSD yacc
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 22 14:16:01 UTC 2003
>Originator:     Alexander N. Kabaev
>Release:        3.3 20030421 (prerelease)
FreeBSD Project
System: FreeBSD 4.8-RC FreeBSD 4.8-RC #2: Mon Mar 24 11:00:40 EST 2003 i386

FreeBSD 5.0-CURRENT FreeBSD 5.0-CURRENT #4: Wed Apr 16 18:23:28 EDT 2003  i386

host: i386-portbld-freebsd4.8
build: i386-portbld-freebsd4.8
target: i386-portbld-freebsd4.8
configured with: ./..//gcc-20030421/configure --disable-nls --with-gnu-as --with-gnu-ld --with-gxx-include-dir=/usr/local/lib/gcc-lib/i386-portbld-freebsd4.8/3.3/include/g++-v3 --with-system-zlib --disable-shared --prefix=/usr/local i386-portbld-freebsd4.8
	gengtype-yacc.y grammar definition file contains token definition
	lines which appear to be bison specific. The string values after the
	token are not supported by the stock FreeBSD yacc and they are not
	required for the parser to work anyway. Attached patch removes
	these string identifiers to facilitate easier integration of the
	upcoming GCC 3.3 release into FreeBSD source tree.

	Also, add defines for malloc and realloc to change them into
	xmalloc and xrealloc respectively. This takes care of yacc
	programs whose genererated code contains invocations of any
	of these functions.
Index: gengtype-yacc.y
RCS file: /usr/ncvs2/src/contrib/gcc/gengtype-yacc.y,v
retrieving revision
diff -u -c -r1.1.1.1 gengtype-yacc.y
*** gengtype-yacc.y	3 Apr 2003 01:50:40 -0000
--- gengtype-yacc.y	22 Apr 2003 14:00:48 -0000
*** 24,29 ****
--- 24,32 ----
  #include "system.h"
  #include "gengtype.h"
+ #define malloc xmalloc
+ #define realloc xrealloc
  %union {
*** 37,47 ****
  %token <t>ENT_STRUCT
! %token GTY_TOKEN "GTY"
! %token UNION "union"
! %token STRUCT "struct"
! %token ENUM "enum"
! %token ALIAS "ptr_alias"
  %token <s>PARAM_IS
  %token NUM
  %token PERCENTPERCENT "%%"
--- 40,50 ----
  %token <t>ENT_STRUCT
! %token GTY_TOKEN
! %token UNION
! %token STRUCT
! %token ENUM
! %token ALIAS
  %token <s>PARAM_IS
  %token NUM
  %token PERCENTPERCENT "%%"

More information about the Gcc-bugs mailing list