This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] v2: Formatted printing for dump_* in the middle-end


On Thu, Aug 02, 2018 at 01:54:07PM -0400, David Malcolm wrote:
> +/* An attribute for annotating formatting printing functions that use
> +   the dumpfile/optinfo formatting codes.  These are the pretty_printer
> +   format codes (see pretty-print.c), with additional codes for middle-end
> +   specific entities (see dumpfile.c).  */
> +
> +#if GCC_VERSION >= 3005
> +#define ATTRIBUTE_GCC_DUMP_PRINTF(m, n) \
> +  __attribute__ ((__format__ (__gcc_dump_printf__, m ,n))) \
> +  ATTRIBUTE_NONNULL(m)
> +#else
> +#define ATTRIBUTE_GCC_DUMP_PRINTF(m, n) ATTRIBUTE_NONNULL(m)
> +#endif

Why >= 3005 rather than >= 9000 ?
GCC 8 and earlier will not handle that format attribute anyway and will just
loudly complain.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]