Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Bison 3 breaks Parrot build #1031

Closed
Util opened this Issue · 4 comments

2 participants

@Util
Owner
Subject: parrot-5.9.0 did not build with bison 3
Date: February 17, 2014 at 10:34:07 AM CST
From: Gerd Pokorra <gp@zimt.uni-siegen.de>
To: parrot-dev <parrot-dev@lists.parrot.org>

Hello!

paroot-5.9.0 seems not to build with bison 3.0.2.

http://kojipkgs.fedoraproject.org//work/tasks/8333/6538333/build.log

I tried to build parrot 5.9.0 for Fedora 21. The build fails. Fedora 21 uses bison in version 3.0.2. So here an error occurs:

compilers/imcc/imcparser.c: In function 'yyparse':
compilers/imcc/imcparser.c:2824:11: error: implicit declaration of function 'YYID' [-Werror=implicit-function-declaration]

There is no problem to build on Fedora 20 which uses a lower bison version.

Could anyone help?

Gerd

@Util
Owner
From: Bruce Gray
Date: February 17, 2014 at 3:14:59 PM CST

I have replicated the problem with Parrot 6.0.0 and Bison 3.0.2, on OS X 10.9.1.

I am working to either resolve the problem, or provide a work-around.


Bruce Gray (Util on IRC and PerlMonks)

@Util
Owner
From: Gerd Pokorra
Date: February 18, 2014 at 2:12:13 AM CST

Hello!

After updating bison to 3.0.2 on Fedora 20 I can replicate the problem there.

But in the spec file I configured Parrot with:

%{__perl} Configure.pl \
   --prefix=%{_usr} \
   --libdir=%{_libdir} \
   --sysconfdir=%{_sysconfdir} \
   --infodir=%{_datadir}/info \
   --mandir=%{_mandir} \
   --cc="%{__cc}" \
   --optimize="$RPM_OPT_FLAGS" \
   --parrot_is_shared \
   --disable-rpath \
   --lex=%{_bindir}/flex

After removing the '--lex' option it builds again.

Gerd

@Util
Owner

Here is my research and analysis:

On 2005-12-09 (first released in 2.2), Bison added the YYID macro, as part of adding support for lint.
YYID is "an identity function that suppresses warnings about constant conditions"; YYID(foo) will return foo.
lint would complain about "while (0)", but will not complain about "while (YYID(0))".

YYID was added for Bison's internal use; when reading the .y file and creating the .c files, Bison would using YYID as part of its own C macros in the .c files.

As for as I can tell, YYID was never intended as a user-level function; it should not have been in anyone's .y file. Since YYID was not documented as internal-only, many projects, including Parrot, did use YYID in their .y files.

On 2012-08-03 (first released in 3.0), Bison removed YYID as part of removing support for lint.
Since YYID was internal-only, its removal was not highlighted as an incompatible change in the release notes.

I tested simply changing while (YYID (0)) to while (0) in compilers/imcc/imcc.y . Those tests look OK under Bison 2.3 and 3.0. It might introduce new lint errors, but probably not, given Lint developments since 2005.

@rurban rurban self-assigned this
@rurban rurban referenced this issue from a commit
@rurban rurban [imcc] bison 3 fixes and more [gh #1031]
Fix #1031 compat with bison 3: remove deprecated and unneeded YYID macro
note one remaining shift/reduce conflict in arglist:  STRINGC ADV_ARROW var at ADV_ARROW
change deprecated %pure_parser to new %pure-parser
regenerate compilers/imcc/imcparser.[ch]

Note: repro with perl Configure.pl --maintainer
90e3128
@rurban rurban closed this issue from a commit
@rurban rurban [imcc] bison 3 fixes and more [gh #1031]
Fix #1031 compat with bison 3: remove deprecated and unneeded YYID macro
note one remaining shift/reduce conflict in arglist:  STRINGC ADV_ARROW var at ADV_ARROW
change deprecated %pure_parser to new %pure-parser
regenerate compilers/imcc/imcparser.[ch]

Note: repro with perl Configure.pl --maintainer
90e3128
@rurban rurban closed this in 90e3128
@rurban
Collaborator

Fixed with commit 90e3128
Author: Reini Urban rurban@cpanel.net
Date: Mon Feb 24 14:54:42 2014 -0600

[imcc] bison 3 fixes and more [gh #1031]

Fix #1031 compat with bison 3: remove deprecated and unneeded YYID macro
note one remaining shift/reduce conflict in arglist:  STRINGC ADV_ARROW var at ADV_ARROW
change deprecated %pure_parser to new %pure-parser
regenerate compilers/imcc/imcparser.[ch]

Note: repro with perl Configure.pl --maintainer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.