1. Python CFFI
  2. Untitled project
  3. cffi
  4. Issues
Issue #128 resolved

alloca implicitly declared on Solaris11 x86

Floris Bruynooghe
created an issue

Hi,

When compiling c/_cffi_backend.c on Solaris 11 x86, gcc complains that alloca is implicitly declared. Simply adding #include <allocal.h> to the file solves this issue.

If you need to put this into an #ifdef section you might be able to use __sun which AFAIK is defined by both gcc and SunStudio.

Regards,

Floris

Comments (3)

  1. Floris Bruynooghe reporter

    Apologies, the include in the original report is indeed a typo, it is #include <alloca.h>.

    I don't think HAVE_ALLOCA_H is defined there as I tried that but didn't work (it only includes Python.h and would need fficonfig.h?). The code committed in that CPython bug does work (with gcc):

    #if defined (__SVR4) && defined (__sun)
    #   include <alloca.h>
    #endif
    

    I'm not sure what the __SVR4 guard brings to the party...

  2. Log in to comment