From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13371 invoked by alias); 28 Jul 2011 14:54:37 -0000 Received: (qmail 13354 invoked by uid 22791); 28 Jul 2011 14:54:35 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Jul 2011 14:54:21 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6SEsJpP013475 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Jul 2011 10:54:19 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6SEsIIb022548; Thu, 28 Jul 2011 10:54:18 -0400 From: Phil Muldoon To: Eli Zaretskii Cc: gdb@sourceware.org Subject: Re: py-breakpoint.c fails to compile with MinGW GCC References: Reply-to: pmuldoon@redhat.com X-URL: http://www.redhat.com Date: Thu, 28 Jul 2011 14:54:00 -0000 In-Reply-To: (Eli Zaretskii's message of "Thu, 28 Jul 2011 08:06:47 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00108.txt.bz2 Eli Zaretskii writes: > The error message is: > > ./python/py-breakpoint.c:1019: error: initializer element is not constant > ./python/py-breakpoint.c:1019: error: (near initialization for `breakpoint_objec t_type.tp_new') > > This is with MinGW GCC 3.4.2 (yes, old, but it worked fine for me > until now). > > I have Python 2.7.1 installed on that machine. > > Removing the last element of the initializer, i.e. this line: > > PyType_GenericNew /* tp_new */ > > allows py-breakpoint.c to compile. > > Is this a bug in GCC, in GDB, in Python, or in my setup? > > TIA There was a patch for this: http://sourceware.org/ml/gdb-patches/2010-09/msg00214.html Specifically from that email: "- I have to modify some gdb python files because the files 'python-function.c', python-cmd.c (...) define some 'static PyTypeObject'. The field 'tp_new' of these static variables is statically initialized with the python 'PyType_GenericNew' function. In Windows port of Python, this function is declared as a dllimport one and cannot be copied at compilation time in a static variable. For these files, I modified the source code - to initialize the 'tp_new' fields to '0' in the static variables and - to affect the proper 'PyType_GenericNew' value in the 'gdbpy_initialize_commands', 'gdbpy_initialize_frames' (...). " It does not seem to have been checked in, even though it was reviewed. I'm also unsure why some folks can compile ok (Dan in that email mentions he has been), and some can't. Cheers Phil