summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-01-06 15:41:56 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-01-06 15:41:56 (GMT)
commit61dbb0086952cdc13f3ca89db810ec365a9cf9b7 (patch)
tree22595ccea2c798864799877ffff24ca30f6f788c
parenta873690d2c027cdd1683a9b8fd013563f9b150c8 (diff)
downloadcpython-61dbb0086952cdc13f3ca89db810ec365a9cf9b7.zip
cpython-61dbb0086952cdc13f3ca89db810ec365a9cf9b7.tar.gz
cpython-61dbb0086952cdc13f3ca89db810ec365a9cf9b7.tar.bz2
Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
-rw-r--r--Include/pymacro.h7
-rw-r--r--Misc/NEWS2
2 files changed, 7 insertions, 2 deletions
diff --git a/Include/pymacro.h b/Include/pymacro.h
index 52e8ee3..5bb4b3d 100644
--- 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
index 15a9736..2d07675 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 3.3.1?
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.