bug-bison
[Top][All Lists]
Advanced

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

Bison & C++


From: Hans Aberg
Subject: Bison & C++
Date: Thu, 13 Dec 2001 12:41:58 +0100

At 11:36 +0100 2001/12/13, Axel Kittenberger wrote:
>The use of alloa can often be easily be workarunded:
>
>like: char * x = alloca(y);
>
>can also as easy be written as:
>{
>    char[y] x;
>    ....
>}

In C++, the problem with alloca is that it cannot be wrapped into a class,
as in say
  T t;
if T() is calling alloca, the allocation will be in the call of T(), and
not when it has expired. This could be circumvented if T() is inlined, but
currently there is no way in C++ to ensure that a function is becoming
inlined.

Thus, alloca does not fit at all into the C++ higher structure paradigm.

And for Bison's future C++ support, I think that one will have to forget
about alloca.

  Hans Aberg





reply via email to

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