Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46821 - Missing "#if YYDEBUG" preprocessor lines causes C++ generated code to fail: undefined name_
Summary: Missing "#if YYDEBUG" preprocessor lines causes C++ generated code to fail: u...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-04 21:37 UTC by Stephen Torri
Modified: 2013-01-28 17:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Bison grammar file which shows the error. (parser.y,533 bytes, text/plain)
2004-04-04 21:38 UTC, Stephen Torri
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Torri 2004-04-04 21:37:33 UTC
Using bison to generate C++ code has a problem compiling a file, parser.y, with the command: bison -d -S lalr1.cc -o parser.cpp parser.y causes an error in compiling the code with g++. The error is a because at line 384 and 523 in /usr/share/bison/lalr1.cc the lines are not wrapped with #if YYDEBUG and an #endif

Reproducible: Always
Steps to Reproduce:
1. Call bison: bison -d -S lalr1.cc -o parser.cpp parser.y
2. Make: g++ parser.cpp


Actual Results:  
parser.cpp: In member function `virtual int yy::Parser::parse()':
parser.cpp:116: error: `name_' undeclared (first use this function)
parser.cpp:116: error: (Each undeclared identifier is reported only once for
   each function it appears in.)
parser.cpp: At global scope:
parser.cpp:386: warning: initialization of negative value `-1' to `const
   unsigned char'
parser.cpp:386: warning: argument of negative value `-1' to `unsigned char'


Expected Results:  
File compiles with error or warnings. I cannot see why g++ is complaining about
the warning. I personally hate warnings so I would like to squash it.
Comment 1 Stephen Torri 2004-04-04 21:38:29 UTC
Created attachment 28716 [details]
Bison grammar file which shows the error.
Comment 2 Stephen Torri 2004-04-04 21:40:57 UTC
Sorry. Adding emerge info:

Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.22-Libertos)
=================================================================
System uname: 2.4.22-Libertos i686 Pentium III (Katmai)
Gentoo Base System version 1.4.3.13
distcc 2.12.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium3 -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium3 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache fixpackages sandbox"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X alsa apm arts avi berkdb bonobo cdr crypt cups curl doc encode esd flash foomaticdb gd gdbm gif gnome gpm gtk gtk2 gtkhtml guile imlib java jpeg kde ldap libg++ libwww mad mikmod mmx motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl php plotutils png python qt quicktime readline sdl slang snmp spell ssl svga tcltk tcpd tetex truetype x86 xml2 xmms xv zlib"
Comment 3 Stephen Torri 2004-04-04 21:41:53 UTC
bison version: sys-devel/bison-1.875  +nls -static
Comment 4 Mark Loeser (RETIRED) gentoo-dev 2005-07-16 10:54:55 UTC
This problem seems to be resolved with the newest stable version of bison in the
tree, bison-1.875d.  Please reopen if you are still having problems.