On 09/26/2012 10:19 PM, Tom Tromey wrote:
"Florian" == Florian Weimer <fwei...@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.

Thanks, I'll wait until next week for further feedback.

Florian> Index: gcc/doc/cpp.texi
[...]
Florian> +contained in the pragma must be a single string literal.  Similary,

Typo, "similarly" -- missing "l".

Thanks, fixed in my copy.

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".

Yes, it's a bit awkward, and I've removed it. I wanted to stress that these directives aren't part of the preprocessor, to avoid confusion.

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.

Good. I don't think we've got the magic quotes inside libgcc, so I'm just going with this, following other examples in the file:

+ cpp_error (pfile, CPP_DL_ERROR, "invalid \"#pragma GCC %s\" directive",
+                error ? "error" : "warning");

--
Florian Weimer / Red Hat Product Security Team

Reply via email to