summaryrefslogtreecommitdiffstats
path: root/Include/pyerrors.h
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2011-02-22 20:15:44 (GMT)
committerBrett Cannon <bcannon@gmail.com>2011-02-22 20:15:44 (GMT)
commitb94767ff44edf5d461d7cb1c8eb5160f83886358 (patch)
treeb43b482e765b0383b3326779f6815e72b2bacccb /Include/pyerrors.h
parent79da6b7075a3d51ae042e77a2afca827e7bce435 (diff)
downloadcpython-b94767ff44edf5d461d7cb1c8eb5160f83886358.zip
cpython-b94767ff44edf5d461d7cb1c8eb5160f83886358.tar.gz
cpython-b94767ff44edf5d461d7cb1c8eb5160f83886358.tar.bz2
Issue #8914: fix various warnings from the Clang static analyzer v254.
Diffstat (limited to 'Include/pyerrors.h')
-rw-r--r--Include/pyerrors.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 4bb3c01..edc8218 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -70,7 +70,17 @@ PyAPI_FUNC(PyObject *) PyErr_Occurred(void);
PyAPI_FUNC(void) PyErr_Clear(void);
PyAPI_FUNC(void) PyErr_Fetch(PyObject **, PyObject **, PyObject **);
PyAPI_FUNC(void) PyErr_Restore(PyObject *, PyObject *, PyObject *);
-PyAPI_FUNC(void) Py_FatalError(const char *message);
+
+#if defined(__clang__) || \
+ (defined(__GNUC__) && \
+ ((__GNUC_MAJOR__ >= 3) || \
+ (__GNUC_MAJOR__ == 2) && (__GNUC_MINOR__ >= 5)))
+#define _Py_NO_RETURN __attribute__((__noreturn__))
+#else
+#define _Py_NO_RETURN
+#endif
+
+PyAPI_FUNC(void) Py_FatalError(const char *message) _Py_NO_RETURN;
#if defined(Py_DEBUG) || defined(Py_LIMITED_API)
#define _PyErr_OCCURRED() PyErr_Occurred()