|
From: SONE T. <ts...@cm...> - 2000-12-14 13:40:08
|
On Thu, Dec 14, 2000 at 04:08:11PM +0300, Phil Krylov wrote: > SONE Takeshi wrote: > > > Ok, I see the problem. > > _alloca() *is* in libgcc.a, but it is not what MSVC people expect. > > It's a support function of gcc, not a 'non-oldname version' of alloca(). > > _alloca() is called implicitly whenever gcc allocates >4096 bytes in stack. > > Ok, I see. But is there any way to use the documented alloca() function? What > libraries should I link against? Maybe I can specify an additional option to > gcc? Currently, when I call alloca(), it returns a pointer to some code instead > of allocated space; it uses __alloca symbol from libgcc.a. Most likely you have a line like '#define alloca _alloca' somewhere? If so delete it. If your source uses '_alloca()' instead of 'alloca()', you need the opposite definition '#define _alloca alloca'. No library other than libgcc is needed, because alloca() is done by compiler itself (with help of __alloca). '_alloca()' in C becomes assembler symbol '__alloca', which may not be called directly. -- Takeshi |