[issue16881] Py_ARRAY_LENGTH macro incorrect with GCC < 3.1

2013-01-06 Thread Jeffrey Armstrong

New submission from Jeffrey Armstrong:

The Py_ARRAY_LENGTH macro (Include/pymacro.h:36) checks to see if using GCC by 
simply looking for __GCC__ being defined.  If so, it uses the GCC extension 
function "__builtin_types_compatible_p."  However, this function was not 
introduced until GCC 3.1.  This simple check for a GCC compiler causes the 
Python build to fail on GCC < 3.1 (2.95 for example).

The check should actually be:

#if (defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
((__GNUC__ == 3) && (__GNU_MINOR__) >= 1) || (__GNUC__ >= 4)))

Similar checks are made in other locations in the core library, just not here.  

This bug was discovered while attempting a build on m68k-atari-mint, which 
relies on GCC 2.95.3.  Other systems may also be using this compiler still.

--
components: Build
messages: 179187
nosy: Jeffrey.Armstrong
priority: normal
severity: normal
status: open
title: Py_ARRAY_LENGTH macro incorrect with GCC < 3.1
type: compile error
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16881] Py_ARRAY_LENGTH macro incorrect with GCC < 3.1

2013-01-06 Thread Christian Heimes

Christian Heimes added the comment:

Fixed in http://hg.python.org/cpython/rev/13c83199c211

--
assignee:  -> christian.heimes
nosy: +christian.heimes
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com