On 09/07/2010 12:55 PM, Giorgos Keramidas wrote:
Hi all,
The Autoconf manual (section 5.5.2, "Particular Function Checks")
recommends the following check for source files that use the alloca()
function:
Which version of the manual are you looking at? This issue was recently
reported; are there still issues beyond what was mentioned in this thread?
http://lists.gnu.org/archive/html/bug-autoconf/2010-08/msg00035.html
In particular, could you demonstrate an actual sample program and
compiler output that backs up your point, as requested in:
http://lists.gnu.org/archive/html/bug-autoconf/2010-08/msg00042.html
The modified version shown below declares a prototype of alloca() only
when HAVE_ALLOCA is unset/undefined regardless of what HAVE_ALLOCA_H is
set to:
#ifdef HAVE_ALLOCA_H
# include<alloca.h>
#elif !defined(HAVE_ALLOCA)
# if defined __GNUC__
# define alloca __builtin_alloca
# elif defined _AIX
# define alloca __alloca
# else
# include<stddef.h>
# ifdef __cplusplus
extern "C"
# endif
void *alloca (size_t);
# endif
#endif
Then again, since AC_FUNC_ALLOCA does indeed set HAVE_ALLOCA via
AC_DEFINE, your patch proposal probably makes sense.
--
Eric Blake ebl...@redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org