help-bison
[Top][All Lists]
Advanced

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

Re: member with constructor not allowed in union


From: Hans Aberg
Subject: Re: member with constructor not allowed in union
Date: Tue, 19 Mar 2002 19:21:02 +0100

At 11:28 -0500 2002/03/19, Anthony DeRobertis wrote:
>On Monday, March 18, 2002, at 06:28 AM, Hans Aberg wrote:
>
>> ... not compile the C output as C++.
>
>This used to work, in the same stable series of bison. It was
>never documented not to work, and perhaps is even documented to
>work.
>
>Changing that is fine and --- in view of the other C++ problems
>using the C skeleton --- a good idea, but not in a stable point
>release.
>
>It breaks a fair amount of software. It breaks stuff that, when
>reading the documentation, should work. Don't do that in a
>stable point release.

Changing bison.simple with respect to "compile C as C++" does not
officially break any code at all, as it never was a documented feature.

The undocumented "compile C as C++" feature broke for two reasons: First,
somebody implemented a dynamic C stack, which was probably OK on early C++
compilers that did not detect the C++ union-non-trivial constructor
prohibition. And then when people upgrade their C++ compilers, this is
suddenly detected and bang, the code does not compile anymore.

There are now two facts: The dynamic C stack is probably great for those
that use C, and this stack is a semantic error under C++ even if it would
compile, as it does not invoke C++ copy constructors when re-allocating
stack memory.

So therefore, it seems me best to keep bison.simple as it is with its
static-dynamic hybrid stack, and introduce as soon as possible a proper C++
skeleton file that does not contain any C++ semantic errors.

  Hans Aberg





reply via email to

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