[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alloca.h example in the manual

From: Eric Blake
Subject: Re: alloca.h example in the manual
Date: Tue, 07 Sep 2010 14:51:23 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2

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()

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?


In particular, could you demonstrate an actual sample program and compiler output that backs up your point, as requested in:

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

Then again, since AC_FUNC_ALLOCA does indeed set HAVE_ALLOCA via AC_DEFINE, your patch proposal probably makes sense.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]