bison-patches
[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: Akim Demaille
Subject: Re: member with constructor not allowed in union
Date: 19 Mar 2002 08:56:21 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

| [Whoops; I sent this to autoconf-patches by mistake.  Sorry.
|  Here is the same message on bison-patches, where it belongs.]

I just did the same...

| > From: Akim Demaille <address@hidden>
| > Date: 18 Mar 2002 11:31:23 +0100
| 
| > We cannot afford to put YYSTYPE (and actually YYLTYPE) into a union,
| > as it makes it impossible for C++ users to use any useful structure
| > in it.
| 
| OK, but (as you know) the code was broken at runtime, because it used
| memcpy to copy the C++ objects when growing the stack, and bypassing
| the constructors and destructors led to "pyrotechnical" behavior as
| described in the Debian bug report at:
| <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=130914>

I agree with that.  But people have it working for most cases, and now
for no cases.  That still makes a difference :)

| > would you handle the reversal in 1.3x?
| 
| I've installed the following patch in 1.3x.  It is not quite a
| reversal, though, because it also fixes the "pyrotechnical" problem,
| by disabling stack growth for C++ parsers that define YYSTYPE.

That's a good bonus, thanks!


| If I understand things correctly this change is not needed for the
| 1.4x version, as it has a separate C++ template.  But if I'm wrong
| please let me know, so that I can install it there too.

We agree, that was indeed what I meant.  Actually, maybe we should
have bison.simple in 1.5x refuse C++ compilers?

Install when you want.



reply via email to

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