Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61dbb00

Browse files
committed
Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
1 parent a873690 commit 61dbb00

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Include/pymacro.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@
2929
parameters. With correct compiler support, such usage will cause a build
3030
error (see Py_BUILD_ASSERT_EXPR).
3131
32-
Written by Rusty Russell, public domain, http://ccodearchive.net/ */
33-
#if (defined(__GNUC__) && !defined(__STRICT_ANSI__))
32+
Written by Rusty Russell, public domain, http://ccodearchive.net/
33+
34+
Requires at GCC 3.1+ */
35+
#if (defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
36+
((__GNUC__ == 3) && (__GNU_MINOR__ >= 1)) || (__GNUC__ >= 4))
3437
/* Two gcc extensions.
3538
&a[0] degrades to a pointer: a different type from an array */
3639
#define Py_ARRAY_LENGTH(array) \

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ What's New in Python 3.3.1?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #16881: Fix Py_ARRAY_LENGTH macro for GCC < 3.1.
16+
1517
- Issue #16856: Fix a segmentation fault from calling repr() on a dict with
1618
a key whose repr raise an exception.
1719

0 commit comments

Comments
 (0)