This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: alloca and c++


Devang Patel <dpatel@apple.com> writes:

| Hello,
| 
| Following gives me undefined  (not undeclared) 'alloca' error in C++.
| Is it expected ?

Yes.

Alloca() is not a standard function.  And on systems I've seen it used,
the appropriate header was included.

| Or am I suppose to use __builtin_alloca()  to get gcc-built-in alloca() 
| in C++ source ?

Certainly.

And declaring standard functions "by hand" is evil.  Use appropriate
header for that.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]