From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100172 invoked by alias); 23 May 2016 18:01:11 -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 100101 invoked by uid 89); 23 May 2016 18:01:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=c89, C89 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 23 May 2016 18:01:04 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D51F7D0D3; Mon, 23 May 2016 18:01:03 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4NI10P3004107; Mon, 23 May 2016 14:01:01 -0400 Subject: Re: [RFA v2 2/2] Fix PR python/17386 - add __index__ method to gdb.Value To: Tom Tromey , gdb-patches@sourceware.org References: <1464024313-11932-1-git-send-email-tom@tromey.com> <1464024313-11932-3-git-send-email-tom@tromey.com> From: Pedro Alves Message-ID: Date: Mon, 23 May 2016 18:01:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <1464024313-11932-3-git-send-email-tom@tromey.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-05/txt/msg00403.txt.bz2 On 05/23/2016 06:25 PM, Tom Tromey wrote: > - valpy_divide /* nb_true_divide */ > + valpy_divide, /* nb_true_divide */ > + NULL, /* nb_inplace_floor_divide */ > + NULL /* nb_inplace_true_divide */ > +#ifndef HAVE_LIBPYTHON_2_4 > + /* This was added in Python 2.5. */ > + , valpy_long /* nb_index */ > +#endif /* HAVE_LIBPYTHON_2_4 */ > }; Are you trying to avoid a trailing comma? We already use trailing commas in many places in common code (and have been for a long while), so the fact that it was valid C89/C++03 doesn't really matter in practice. (It was a common extension that later became valid in C99/C++11.) IOW, this can be: + valpy_divide, /* nb_true_divide */ + NULL, /* nb_inplace_floor_divide */ + NULL, /* nb_inplace_true_divide */ +#ifndef HAVE_LIBPYTHON_2_4 + /* This was added in Python 2.5. */ + valpy_long, /* nb_index */ +#endif /* HAVE_LIBPYTHON_2_4 */ Thanks, Pedro Alves