[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Recommended alloca declaration breaks on alloca.c
From: |
James Youngman |
Subject: |
Re: Recommended alloca declaration breaks on alloca.c |
Date: |
Sun, 10 Apr 2005 23:38:02 +0100 |
User-agent: |
Mutt/1.3.28i |
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.