This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: alloca and c++
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- To: Devang Patel <dpatel at apple dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 01 Feb 2002 21:12:31 +0100
- Subject: Re: alloca and c++
- Organization: CodeSourcery, LLC
- References: <D0512925-1745-11D6-9970-00039310EDEA@apple.com>
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