summaryrefslogtreecommitdiffstats
path: root/clang/docs
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-10-12 19:46:30 +0000
committerTed Kremenek <kremenek@apple.com>2011-10-12 19:46:30 +0000
commita35d67dfd927191a16cf24931981d79901938381 (patch)
treefb0f9889925fcce82c4e76fb0bd5cd1e6211a72f /clang/docs
parent205d0445529eb985a1485ff8e2a18908f75f3bb1 (diff)
downloadbcm5719-llvm-a35d67dfd927191a16cf24931981d79901938381.tar.gz
bcm5719-llvm-a35d67dfd927191a16cf24931981d79901938381.zip
Implement built-in macro '__has_warning', which allows one to query if a warning flag is valid. Fixes <rdar://problem/10263428>.
llvm-svn: 141802
Diffstat (limited to 'clang/docs')
-rw-r--r--clang/docs/LanguageExtensions.html17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/docs/LanguageExtensions.html b/clang/docs/LanguageExtensions.html
index d8a57df4865..ef57a659c4d 100644
--- a/clang/docs/LanguageExtensions.html
+++ b/clang/docs/LanguageExtensions.html
@@ -300,6 +300,23 @@ and will issue a warning if used in the top-level compilation
file. A warning will also be issued if an absolute path
is used in the file argument.</p>
+
+<!-- ======================================================================= -->
+<h3><a name="__has_warning">__has_warning</a></h3>
+<!-- ======================================================================= -->
+
+<p>This function-like macro takes a string literal that represents a command
+ line option for a warning and returns true if that is a valid warning
+ option.</p>
+
+<blockquote>
+<pre>
+#if __has_warning("-Wformat")
+...
+#endif
+</pre>
+</blockquote>
+
<!-- ======================================================================= -->
<h2 id="builtinmacros">Builtin Macros</h2>
<!-- ======================================================================= -->
OpenPOWER on IntegriCloud