[Python-checkins] cpython (3.3): Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
christian.heimes
python-checkins at python.org
Sun Jan 6 16:42:30 CET 2013
http://hg.python.org/cpython/rev/13c83199c211
changeset: 81300:13c83199c211
branch: 3.3
parent: 81296:c1fc6b6d1cfc
user: Christian Heimes <christian at cheimes.de>
date: Sun Jan 06 16:41:56 2013 +0100
summary:
Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
files:
Include/pymacro.h | 7 +++++--
Misc/NEWS | 2 ++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Include/pymacro.h b/Include/pymacro.h
--- a/Include/pymacro.h
+++ b/Include/pymacro.h
@@ -29,8 +29,11 @@
parameters. With correct compiler support, such usage will cause a build
error (see Py_BUILD_ASSERT_EXPR).
- Written by Rusty Russell, public domain, http://ccodearchive.net/ */
-#if (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+ Written by Rusty Russell, public domain, http://ccodearchive.net/
+
+ Requires at GCC 3.1+ */
+#if (defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
+ ((__GNUC__ == 3) && (__GNU_MINOR__ >= 1)) || (__GNUC__ >= 4))
/* Two gcc extensions.
&a[0] degrades to a pointer: a different type from an array */
#define Py_ARRAY_LENGTH(array) \
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@
Core and Builtins
-----------------
+- Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
+
- Issue #16856: Fix a segmentation fault from calling repr() on a dict with
a key whose repr raise an exception.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list