alloca and c++

Devang Patel dpatel@apple.com
Fri Feb 1 13:46:00 GMT 2002


I found the solution, so let me answer my question myself,

On Friday, February 1, 2002, at 12:25  PM, Devang Patel wrote:

> So, my question is :
> Even though I include stdilib.h,
> I can not use alloca() in c++ and I must use __builtin_alloca().
> Is it True ?

This is true.
GCC C++ compiler does not allow to directly use alloca() as it is.
But, If I include alloca.h it works, because
alloca.h has
...
#define alloca(size)  __builtin_alloca(size)
...

BTW, the Darwin system does not have alloca.h ;-)
(Darwin needs to get alloca.h ASAP)

Thank you,
Devang



More information about the Gcc mailing list