[Python-checkins] cpython (3.3): ctypes: AIX needs an explicit #include <alloca.h> to get alloca()

Christian Heimes christian at python.org
Tue Jun 18 13:45:05 CEST 2013

Am 18.06.2013 13:32, schrieb Victor Stinner:
> 2013/6/18 Christian Heimes <christian at python.org>:
>> Am 18.06.2013 12:56, schrieb Jeremy Kloth:
>>> On Mon, Jun 17, 2013 at 2:02 PM, victor.stinner
>>>> +#include <alloca.h>
>>> This header is not present on Windows, thus breaking all the Windows
>>> buildbots.  Perhaps it should be wrapped in an AIX-specific #ifdef?
> Oh really? Portability is complex :-) I only tested on Linux, but I
> expected this header to be part of the C standard...

It's neither C99 nor POSIX.1-2001. I guess it's just too fragile and not
portable enough. http://c-faq.com/malloc/alloca.html

>> I have added HAVE_ALLOCA_H to configure:
>> http://hg.python.org/cpython/rev/7b6ae19dd116
> Cool, thanks.

You are welcome. alloca() is documented to require <alloca.h>. It merely
works with GCC because the compiler translates the function call to
inline code.


More information about the Python-checkins mailing list