[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: alloca patch
From: |
Patrick Welche |
Subject: |
Re: alloca patch |
Date: |
Fri, 21 Dec 2012 17:14:09 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Fri, Dec 21, 2012 at 12:35:17AM -0800, Paul Eggert wrote:
> -void *alloca (size_t);
> -# endif
> -# endif
> +# ifdef __cplusplus
> +extern "C"
> # endif
> +void *alloca (size_t);
> # endif
> #endif
> ]], [[char *p = (char *) alloca (1);
Actually I still don't understand why the fall through case is
void *alloca (size_t);
In the documentation case, if you don't HAVE_ALLOCA, why declare alloca()?
In the AC_FUNC_ALLOCA case, why look for a function which isn't declared
in a public header nor is one of the builtins of the compilers you know about?
I can still see this failing in a slightly contrived way: imagine not having
an alloca which is a macro, but which is a real function. My stdlib.h will
then declare alloca(). The test in AC_FUNC_ALLOCA will then decare alloca
again in the fall through case.
Cheers,
Patrick
PS my stdlib.h has:
#if defined(alloca) && (alloca == __builtin_alloca) && \
defined(__GNUC__) && (__GNUC__ < 2)
void *alloca(int); /* built-in for gcc */
#elif defined(__PCC__) && !defined(__GNUC__)
#define alloca(size) __builtin_alloca(size)
#else
void *alloca(size_t);
#endif /* __GNUC__ */