summaryrefslogtreecommitdiff
path: root/gcc/doc/cpp.texi
diff options
context:
space:
mode:
authorfw <fw@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-04 15:33:11 +0000
committerfw <fw@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-04 15:33:11 +0000
commita1f1781ae8b54c384b7d193c2fd3ac8efc86932a (patch)
tree3992b4ad76993de282e9b81bbe8d85f5c7834619 /gcc/doc/cpp.texi
parent1ca9d4a972802d9b9820437130392a6dc59181a8 (diff)
downloadgcc-a1f1781ae8b54c384b7d193c2fd3ac8efc86932a.tar.gz
Implement #pragma GCC warning/error
2012-10-04 Florian Weimer <fweimer@redhat.com> * doc/cpp.texi (Pragmas): Document #pragma GCC warning, #pragma GCC error. 2012-10-04 Florian Weimer <fweimer@redhat.com> * c-c++-common/cpp/diagnostic-pragma-1.c: New testcase. 2012-10-04 Florian Weimer <fweimer@redhat.com> * directives.c (do_pragma_warning_or_error): New. (do_pragma_warning): New. (do_pragma_error): New. (_cpp_init_internal_pragmas): Register new pragmas. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192084 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc/cpp.texi')
-rw-r--r--gcc/doc/cpp.texi9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index b363db014bf..fa5989e6bde 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -3634,6 +3634,15 @@ This pragma takes no arguments. It causes the rest of the code in the
current file to be treated as if it came from a system header.
@xref{System Headers}.
+@item #pragma GCC warning
+@itemx #pragma GCC error
+@code{#pragma GCC warning "message"} causes the preprocessor to issue
+a warning diagnostic with the text @samp{message}. The message
+contained in the pragma must be a single string literal. Similarly,
+@code{#pragma GCC error "message"} issues an error message. Unlike
+the @samp{#warning} and @samp{#error} directives, these pragmas can be
+embedded in preprocessor macros using @samp{_Pragma}.
+
@end ftable
@node Other Directives