Re: [Python-Dev] [Python-checkins] cpython: Issue #19976: Argument Clinic METH_NOARGS functions now always
Probably Rietveld did not send mail, so I mention my review comments again: larry.hastings <python-checkins@python.org> wrote:
+#ifdef __GNUC__ +#define Py_UNUSED(name) _unused_ ## name __attribute__((unused)) +#else +#define Py_UNUSED(name) _unused_ ## name +#endif +
The Intel compiler defines __GNUC__ but chokes on the __attribute__(). This works: #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+_pickle_Pickler_clear_memo(PyObject *self, PyObject *Py_UNUSED(ignored))
I'm not a native speaker, but UNUSED(ignored) reads strange to me. I would prefer UNUSED(args). Stefan Krah
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 Py_UNUSED(name) _unused_ ## name __attribute__((unused)) +#else +#define Py_UNUSED(name) _unused_ ## name +#endif +
The Intel compiler defines __GNUC__ but chokes on the __attribute__().
This works:
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
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
Stefan Behnel <stefan_ml@behnel.de> wrote:
""" #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.
You're right, icc version 12.0 supports the attribute. It must have been some earlier version that failed. Stefan Krah
participants (2)
-
Stefan Behnel
-
Stefan Krah