https://github.com/python/cpython/commit/e2ed5adcb5db2d70cfa72da1ba8446f7aa9e05cd commit: e2ed5adcb5db2d70cfa72da1ba8446f7aa9e05cd branch: master author: Alexey Izbyshev <izbyshev at ispras.ru> committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> date: 2018年11月02日T09:32:26-07:00 summary: bpo-35147: Fix _Py_NO_RETURN for GCC (GH-10300) Use `__GNUC__` instead of non-existing `__GNUC_MAJOR__`. https://bugs.python.org/issue35147 files: M Include/pyerrors.h diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 4e2995469f3c..808e0def06b4 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -94,9 +94,9 @@ PyAPI_FUNC(void) PyErr_SetExcInfo(PyObject *, PyObject *, PyObject *); #endif #if defined(__clang__) || \ - (defined(__GNUC_MAJOR__) && \ - ((__GNUC_MAJOR__ >= 3) || \ - (__GNUC_MAJOR__ == 2) && (__GNUC_MINOR__ >= 5))) + (defined(__GNUC__) && \ + ((__GNUC__ >= 3) || \ + (__GNUC__ == 2) && (__GNUC_MINOR__ >= 5))) # define _Py_NO_RETURN __attribute__((__noreturn__)) #elif defined(_MSC_VER) # define _Py_NO_RETURN __declspec(noreturn)