This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] v2: Formatted printing for dump_* in the middle-end
- From: Jakub Jelinek <jakub at redhat dot com>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: Joseph Myers <joseph at codesourcery dot com>, Richard Biener <richard dot guenther at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 27 Aug 2018 08:57:51 +0200
- Subject: Re: [PATCH] v2: Formatted printing for dump_* in the middle-end
- References: <alpine.DEB.2.20.1807311950140.2939@digraph.polyomino.org.uk> <1533232447-54802-1-git-send-email-dmalcolm@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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