[New-bugs-announce] [issue17547] "checking whether gcc supports ParseTuple __format__... " erroneously returns yes with gcc 4.8

Dave Malcolm report at bugs.python.org
Mon Mar 25 20:33:56 CET 2013


New submission from Dave Malcolm:

It appears that gcc's -Wformat warning changed from being on by default in gcc 4.7 and earlier to being off by default in gcc 4.8, needing to be enabled with -Wformat (or -Wall), if I'm reading:
http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=193304
correctly

This breaks CPython's configure.ac test:
  "Check whether GCC supports PyArg_ParseTuple format"
in that the warning the test is supposed to emit is guarded by -Wformat, hence with gcc 4.8 this test always emits:
  checking whether gcc supports ParseTuple __format__... yes
despite the fact that gcc doesn't.

This leads to the pyconfig.h defining HAVE_ATTRIBUTE_FORMAT_PARSETUPLE, and thus we get this error when trying later use the python build to build a C extension module where -Wformat (or -Wall) *is* supplied:
In file included from /usr/include/python2.7/Python.h:126:0,
                 from isys.c:20:
/usr/include/python2.7/modsupport.h:28:1: error: 'PyArg_ParseTuple' is an unrecognized format function type [-Werror=format=]
 PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);

Am attaching a work-in-progress patch to supply the missing argument at configure time

Note to self: am tracking this downstream as https://bugzilla.redhat.com/show_bug.cgi?id=927358

----------
components: Build
files: 00175-fix-configure-Wformat.patch
keywords: patch
messages: 185226
nosy: dmalcolm
priority: normal
severity: normal
stage: patch review
status: open
title: "checking whether gcc supports ParseTuple __format__... " erroneously returns yes with gcc 4.8
type: compile error
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file29574/00175-fix-configure-Wformat.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17547>
_______________________________________


More information about the New-bugs-announce mailing list