Re: [PATCH 01/28] introduce CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF and use it

Pedro Alves
2013-05-21T00:20:42Z

On 05/20/2013 09:08 PM, Tom Tromey wrote:
>>>>>> >>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>>> >> +#ifdef WITH_CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF_ATTRIBUTE
>>> >> +#define CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF(ARG) \
>>> >> + __attribute__ ((cpychecker_type_object_for_typedef (ARG)))
> Pedro> Could we have a comment here with a short hint at what this is
> Pedro> all about? I assume from the patch that
> Pedro> WITH_CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF_ATTRIBUTE is defined
> Pedro> by cpychecker itself (not autoconf/config.h), but I can see
> Pedro> future readers getting confused.
>
> Sure thing.
> Here is the patch I am checking in.

...

> --- a/gdb/python/python-internal.h
> +++ b/gdb/python/python-internal.h
> @@ -20,6 +20,19 @@
> #ifndef GDB_PYTHON_INTERNAL_H
> #define GDB_PYTHON_INTERNAL_H
>
> +/* These WITH_* macros are defined by the CPython API checker that
> + comes with the Python plugin for GCC. See:
> + https://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html
> + The checker defines a WITH_ macro for each attribute it
> + exposes. */
> +
> +#ifdef WITH_CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF_ATTRIBUTE
> +#define CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF(ARG) \
> + __attribute__ ((cpychecker_type_object_for_typedef (ARG)))
> +#else
> +#define CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF(ARG)
> +#endif
> +

That's perfect. Thanks!

--
--
Pedro Alves