This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [CPP] Add pragmas for emitting diagnostics
- From: Tom Tromey <tromey at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 26 Sep 2012 14:19:49 -0600
- Subject: Re: [CPP] Add pragmas for emitting diagnostics
- References: <5061BEC4.7080506@redhat.com>
>>>>> "Florian" == Florian Weimer <fweimer@redhat.com> writes:
Florian> This patch adds support for #pragma GCC warning and #pragma GCC
Florian> error. These pragmas can be used from preprocessor macros,
Florian> unlike the existing #warning and #error directives. Library
Florian> authors can use these pragmas to add deprecation warnings to
Florian> macros they define.
I'm not sure if my libcpp review powers extend to an extension like
this.
It seems reasonable to me though.
Florian> Index: gcc/doc/cpp.texi
[...]
Florian> +contained in the pragma must be a single string literal. Similary,
Typo, "similarly" -- missing "l".
Florian> +@code{#pragma GCC error "message"} issues an error message. Unlike
Florian> +the @samp{#warning} and @samp{#error} directives provided by
Florian> +compilers, these pragmas can be embedded in preprocessor macros using
I would just remove "provided by compilers".
Florian> + cpp_error (pfile, CPP_DL_ERROR, "invalid #pragma GCC %s directive",
It seems to me that the '#pragma GCC %s' part should have quotes around
it.
Tom