[Python-Dev] [Python-checkins] cpython: Issue #19976: Argument Clinic METH_NOARGS functions now always (original) (raw)

Stefan Behnel stefan_ml at behnel.de
Sat Jan 4 22:17:43 CET 2014


Stefan Krah, 04.01.2014 21:00:

Probably Rietveld did not send mail, so I mention my review comments again:

larry.hastings wrote: +#ifdef GNUC +#define PyUNUSED(name) unused ## name attribute((unused)) +#else +#define PyUNUSED(name) unused ## name +#endif + The Intel compiler defines GNUC but chokes on the attribute(). This works: _#if defined(GNUC) && !defined(INTELCOMPILER)

We use this in Cython and according to the mailing list echo, it would seem that there are people running it through Intel's compiler as well:

""" #ifndef CYTHON_UNUSED

if defined(GNUC)

if !(defined(__cplusplus)) || (GNUC > 3 || (GNUC == 3 &&

GNUC_MINOR >= 4))

define CYTHON_UNUSED attribute ((unused))

else

define CYTHON_UNUSED

endif

elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))

define CYTHON_UNUSED attribute ((unused))

else

define CYTHON_UNUSED

endif

#endif """

I wonder why this works, though, given that you say Intel doesn't support "attribute". The only difference I can spot is the space behind it.

In any case, I agree that the right way to do it is a bit more complex than in the original commit.

Stefan



More information about the Python-Dev mailing list