Re: [RFA v2 2/2] Fix PR python/17386 - add __index__ method to gdb.Value

Pedro Alves
2016-05-23T18:01:11Z

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