This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Diagnostic Patch] Clean-up diagnostic facilities in diagnostic.c
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>, Dodji Seketeli <dodji at redhat dot com>
- Date: Mon, 06 Jun 2016 16:26:02 -0400
- Subject: Re: [Diagnostic Patch] Clean-up diagnostic facilities in diagnostic.c
- Authentication-results: sourceware.org; auth=none
- References: <57553A79 dot 4060508 at oracle dot com>
On Mon, 2016-06-06 at 10:55 +0200, Paolo Carlini wrote:
> Hi,
>
> yesterday I had the idea of this small clean-up: move the work done
> by
> emit_diagnostic to a new non-variadic diagnostic_impl and use it to
> implement the former and all the various inform, warning, permerror,
> etc
> (lately we have the *_at_rich_loc variants too). Something similar
> can
> be done for inform_n, warning_n and errror_n. There is the minor
> subtlety of the declarations decorated with ATTRIBUTE_GCC_DIAG when
> available to suppress the build-time warning: I think I did it the
> right
> way, I took inspiration from the declarations of diagnostic_set_info,
> etc, in diagnostic.h.
>
> Tested x86_64-linux.
Thanks, looks like a nice simplification.
I see the new prototypes are wrapped in #ifdef ATTRIBUTE_GCC_DIAG.
Isn't that redundant? Looking at diagnostic-core.h, isn't it always
defined? (perhaps to the empty string)
Also the new functions are missing comments.
Other than that, LGTM.