This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA v2 2/2] Fix PR python/17386 - add __index__ method to gdb.Value
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Mon, 23 May 2016 19:01:00 +0100
- Subject: Re: [RFA v2 2/2] Fix PR python/17386 - add __index__ method to gdb.Value
- Authentication-results: sourceware.org; auth=none
- References: <1464024313-11932-1-git-send-email-tom at tromey dot com> <1464024313-11932-3-git-send-email-tom at tromey dot com>
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