On 7 May 2015 at 11:09, Mikhail Maltsev wrote:
> I tried to compile it with current trunk on x86_64-unknown-linux-gnu
> (CentOS7) with Python 2.7.5 (It's default in CentOS7), but unfortunately
> the build failed. The reason is that the plugin #include's <Python.h>
> before GCC's headers.
>
> gcc/system.h #define's __STDC_FORMAT_MACROS in order to get PRId64 and
> other similar macros defined by inttypes.h. Probably Python.h includes
> it earlier without this definition. The recommended way
> (https://gcc.gnu.org/onlinedocs/gccint/Plugin-API.html#Plugin-API) is
> always include gcc-plugin.h first.

And Python.h thinks it has the right to insist that it should always be first:

https://docs.python.org/2/c-api/intro.html#include-files

(I won't say what I think about that requirement as this is a family
friendly list ;-)

Reply via email to