[BUG] Wrong Python2.7 configuration

Alexey Pavlov alexpux@gmail.com
Tue Jul 30 17:52:00 GMT 2013


2013/7/30 Corinna Vinschen:
> On Jul 30 18:00, Pavel Fedin wrote:
>>  Hello!
>>
>>  During building Insight for Cygwin i hit this error:
>> --- cut ---
>> gcc -g -O2    -I. -I. -I./common -I./config
>> -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H
>> -I./../include/opcode -I./../opcodes/.. -I./../readline/..  -I../bfd
>> -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber
>> -I./gnulib/import -Ibuild-gnulib/import   -DTUI=1  -DGDBTK
>> -I/usr/include/python2.7 -I/usr/include/python2.7 -Wall
>> -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused
>> -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts
>> -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body
>> -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition
>> -Wformat-nonliteral -Werror -c -o mi-main.o -MT mi-main.o -MMD -MP  -MF
>> .deps/mi-main.Tpo ./mi/mi-main.c
>> In file included from /usr/include/python2.7/Python.h:126:0,
>>                  from ./python/python-internal.h:95,
>>                  from ./mi/mi-main.c:56:
>> /usr/include/python2.7/modsupport.h:27:1: error: '_PyArg_ParseTuple_SizeT'
>> is an unrecognized format function type [-Werror=format=]
>>  PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...)
>> Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
>>  ^
>> cc1: all warnings being treated as errors
>> --- cut ---
>>
>>  The problem obviously happens because of incorrect
>> HAVE_ATTRIBUTE_FORMAT_PARSETUPLE setting in python27/pyconfig.h. Likely
>> python's configure test is broken. The relevant discussion is here:
>> https://bugzilla.redhat.com/show_bug.cgi?id=927358
>
> This only occurs in 64 bit Cygwin, afaics.  I reported this problem two
> weeks ago on cygwin-apps(*) already.
>
> Jason?  Yaakov?  Ping?
>
> As a local workaround, I disabled the definition of
> HAVE_ATTRIBUTE_FORMAT_PARSETUPLE in /usr/include/python2.7/pyconfig.h.
>
>
This problem is resolved by next patch:

diff -Naur Python-3.2.5-cygwin/configure.ac Python-3.2.5/configure.ac
--- Python-3.2.5-cygwin/configure.ac 2013-07-22 13:54:55.758789100 +0400
+++ Python-3.2.5/configure.ac 2013-07-22 15:41:55.582031300 +0400
@@ -1177,7 +1182,7 @@
 then
   AC_MSG_CHECKING(whether gcc supports ParseTuple __format__)
   save_CFLAGS=$CFLAGS
-  CFLAGS="$CFLAGS -Werror"
+  CFLAGS="$CFLAGS -Werror -Wformat"
   AC_COMPILE_IFELSE([
     AC_LANG_PROGRAM([[void
f(char*,...)__attribute((format(PyArg_ParseTuple, 1, 2)));]], [[]])
   ],[


The same patch for python2.x

Regards,
Alexey.
> Corinna
>
>
> (*) http://cygwin.com/ml/cygwin-apps/2013-07/msg00214.html
>
> --
> Corinna Vinschen                  Please, send mails regarding Cygwin to
> Cygwin Maintainer                 cygwin AT cygwin DOT com
> Red Hat
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list