From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28542 invoked by alias); 29 Nov 2012 19:13:55 -0000 Received: (qmail 28529 invoked by uid 22791); 29 Nov 2012 19:13:52 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,MSGID_FROM_MTA_HEADER,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e06smtp13.uk.ibm.com (HELO e06smtp13.uk.ibm.com) (195.75.94.109) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 19:13:46 +0000 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 29 Nov 2012 19:13:44 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 29 Nov 2012 19:13:42 -0000 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qATJDX2340042632 for ; Thu, 29 Nov 2012 19:13:33 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qATJDe5m014304 for ; Thu, 29 Nov 2012 12:13:40 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id qATJDdkF014222; Thu, 29 Nov 2012 12:13:39 -0700 Message-Id: <201211291913.qATJDdkF014222@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 29 Nov 2012 20:13:39 +0100 Subject: [commit] Fix !HAVE_THREAD Python build error (Re: RFC: fix atexit.register) To: tromey@redhat.com (Tom Tromey) Date: Thu, 29 Nov 2012 19:13:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <874nn5d5ur.fsf@fleche.redhat.com> from "Tom Tromey" at Sep 10, 2012 01:40:12 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit x-cbid: 12112919-2966-0000-0000-000006077C12 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00887.txt.bz2 Tom Tromey wrote: > +static void > +finalize_python (void *ignore) > +{ > + /* We don't use ensure_python_env here because if we ever ran the > + cleanup, gdb would crash -- because the cleanup calls into the > + Python interpreter, which we are about to destroy. It seems > + clearer to make the needed calls explicitly here than to create a > + cleanup and then mysteriously discard it. */ > + PyGILState_Ensure (); > + python_gdbarch = target_gdbarch; > + python_language = current_language; > + > + Py_Finalize (); > +} If WITH_THREAD is not defined, we use this definition from python-internal.h: #define PyGILState_Ensure() ((PyGILState_STATE) 0) This causes build to abort for me with the error: /home/uweigand/fsf/gdb-head/gdb/python/python.c: In function 'finalize_python': /home/uweigand/fsf/gdb-head/gdb/python/python.c:1418: warning: statement with no effect Fixed by the following patch, committed as obvious. Bye, Ulrich ChangeLog: * python/python.c (finalize_python): Cast unused PyGILState_Ensure return value to void to avoid compiler warning. Index: gdb/python/python.c =================================================================== RCS file: /cvs/src/src/gdb/python/python.c,v retrieving revision 1.101 diff -u -p -r1.101 python.c --- gdb/python/python.c 12 Nov 2012 19:24:14 -0000 1.101 +++ gdb/python/python.c 29 Nov 2012 18:58:30 -0000 @@ -1415,7 +1415,7 @@ finalize_python (void *ignore) Python interpreter, which we are about to destroy. It seems clearer to make the needed calls explicitly here than to create a cleanup and then mysteriously discard it. */ - PyGILState_Ensure (); + (void) PyGILState_Ensure (); python_gdbarch = target_gdbarch (); python_language = current_language; -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com