From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32449 invoked by alias); 21 May 2013 16:36:49 -0000 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 Received: (qmail 32438 invoked by uid 89); 21 May 2013 16:36:49 -0000 X-Spam-SWARE-Status: No, score=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 21 May 2013 16:36:49 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4LGalp0017412 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 May 2013 12:36:47 -0400 Received: from barimba (ovpn-113-72.phx2.redhat.com [10.3.113.72]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r4LGaklp024305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 21 May 2013 12:36:47 -0400 From: Tom Tromey To: Pedro Alves Cc: Jan Kratochvil , gdb-patches@sourceware.org Subject: Re: [patch] Compilation regression with python-2.6 [Re: [PATCH 24/28] introduce gdb_pymodule_addobject] References: <87ehe638ww.fsf@fleche.redhat.com> <8761ziy43f.fsf@fleche.redhat.com> <20130521075803.GA404@host2.jankratochvil.net> <519B9B54.9090907@redhat.com> <20130521161400.GA2763@host2.jankratochvil.net> <519B9F9A.9070600@redhat.com> Date: Tue, 21 May 2013 16:36:00 -0000 In-Reply-To: <519B9F9A.9070600@redhat.com> (Pedro Alves's message of "Tue, 21 May 2013 17:23:54 +0100") Message-ID: <877gisl275.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-05/txt/msg00774.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> I notice that py_decref could actually be using Py_XDECREF instead Pedro> of doing the explicit 'if (py)' check. Pedro> - /* Note that we need the extra braces in this 'if' to avoid a Pedro> - warning from gcc. */ Pedro> if (py) Pedro> - { Pedro> - Py_DECREF (py); Pedro> - } Pedro> + Py_DECREF (py); The X is missing. Also, as discussed on irc, if you do this you might as well zap make_cleanup_py_xdecref and py_xdecref. I think having one set of cleanup functions is plenty. The NULL check can't cost much, either in performance or clarity. Really I would prefer to get rid of decref cleanups at all, since they mess with the checker. But this is a pain, and probably not worth the effort unless we think we could really get to 0 false reports. Tom