[pypy-issue] Issue #2817: Py_GCC_ATTRIBUTE missing (pypy/pypy)

Hrvoje Nikšić issues-reply at bitbucket.org
Thu May 3 10:34:13 EDT 2018


New issue 2817: Py_GCC_ATTRIBUTE missing
https://bitbucket.org/pypy/pypy/issues/2817/py_gcc_attribute-missing

Hrvoje Nikšić:

The `Py_GCC_ATTRIBUTE` macro is missing from the C API emulation headers. While it is not strictly a part of the Python/C API as it's not documented, it also does not begin with an underscore, so there is code out there that relies on it in their own extensions. (I discovered that by attempting to compile in-house Python/C extensions under PyPy.)

It can be easily added by copying the definition from CPython:

```
#!c

#if (!defined(__GNUC__) || __GNUC__ < 2 || \
     (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ) && \
    !defined(RISCOS)
#define Py_GCC_ATTRIBUTE(x)
#else
#define Py_GCC_ATTRIBUTE(x) __attribute__(x)
#endif
```




More information about the pypy-issue mailing list