[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bison 2.6.2 generates incompatible header file

From: Bill Allombert
Subject: Re: bison 2.6.2 generates incompatible header file
Date: Thu, 18 Oct 2012 17:53:05 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Thu, Oct 18, 2012 at 02:15:38PM +0200, Akim Demaille wrote:
> Hi Bill,
> > (and more to the point, Debian 'testing' includes bison 2.5 and
> > Debian 'unstable' includes bison 2.6 and some software in 
> > 'testing' does not build on 'unstable', but this is something for
> > the Debian maintainer to deal with.)
> I'd be happy to help, as in the past, we also "broke" the backward
> compatibility by fixing bugs in Bison that revealed incorrect code
> in user code; this ended by fixing the code that was relying on a
> bug in Bison.

The problem is that testing is frozen so this is not an option.
The real fix is to refrain from uploading new major version of bison to 
during a freeze.

By the way, the real package breaking is csound. The log is here:
(I am not involved with csound in anyway, though)

> > A way to fix the problem could be to add
> > 
> > #ifdef __cplusplus
> > extern "C" {
> > #endif
> > ...
> > #ifdef __cplusplus
> > }
> > #endif
> > 
> > in the generated parse.tab.h.
> This is not correct for people who do not want this guy to be
> in extern "C".

I agree, but I guess it is your turn to give an example that work with bison
2.5 and 2.6 but would not work with my change.

As far as I see, this requires the user to build parse.tab.c with g++, otherwise
parse() will have C linkage anyway. C++ requires prototypes, so the user needs 
provide a prototype for parse() when using bison 2.5 at least.
When you allow to compile C files with a C++ compiler, it is customary to use 
extern "C", otherwise you ABI depend on the compiler.

But I quite understand why you would be wary of apply this change.
Maybe documenting to do 
extern "C" {
#include "parse.tab.h"
in case of problem is the lesser evil.

Bill. <address@hidden>

Imagine a large red swirl here. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]