On Sun, Apr 10, 2005 at 02:02:20PM +0200, Hrvoje Niksic wrote:
> It turns out that the alloca declaration that the Autoconf manual[1]
> recommends for config.h declares alloca() as returning char *, whereas
> the C implementation I use declares it as returning void *.  But
> regardless of alloca.c, another problem is that, on Linux, stdlib.h
> includes alloca.h, which also declares void *alloca().
> 
> I fixed this problem by changing the declaration from "char
> *alloca();" to "void *alloca();".  Is there a better fix, or should
> the manual be updated for alloca to return void *?

If the GNU C library implements alloca() itself, then it should be
declared in /usr/include/alloca.h.  Otherwise, if it's implemented by
the GNU C compiler only, then I would think it should be declared in a
GCC header file (for example /usr/lib/gcc-lib/*/*/include/alloca.h).

Regards,
James.


Reply via email to