aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-04-29 15:42:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-04-29 15:42:02 +0200
commitf041edd254e35b6d7c1b82df5919d573400912e4 (patch)
treea587b64ce7228017d3b4e9c6879b68a64492d875
parentaacc631ed51b97eadfcbc8f4f8401171ef730a13 (diff)
Add info on disable pragma warning in Clang
-rw-r--r--doc/manual.xhtml35
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/manual.xhtml b/doc/manual.xhtml
index 73e5f7e..459476a 100644
--- a/doc/manual.xhtml
+++ b/doc/manual.xhtml
@@ -548,6 +548,7 @@ for consistency.
<tr><th>12.6.3</th><td><a href="#12.6.3">Sun C++</a></td></tr>
<tr><th>12.6.4</th><td><a href="#12.6.4">IBM XL C++</a></td></tr>
<tr><th>12.6.5</th><td><a href="#12.6.5">HP aC++</a></td></tr>
+ <tr><th>12.6.6</th><td><a href="#12.6.6">Clang</a></td></tr>
</table>
</td>
</tr>
@@ -11817,6 +11818,40 @@ xlC -qsuppress=1540-1401 ...
aCC +W2161 ...
</pre>
+ <h3><a name="12.6.6">12.6.6 Clang</a></h3>
+
+ <p>Clang does not issue warnings about unknown pragmas
+ unless requested with the <code>-Wall</code> command line option.
+ To disable only the unknown pragma warning, we can add the
+ <code>-Wno-unknown-pragmas</code> option after <code>-Wall</code>,
+ for example:</p>
+
+ <pre class="terminal">
+clang++ -Wall -Wno-unknown-pragmas ...
+ </pre>
+
+ <p>We can also disable this warning for only a specific header or
+ a fragment of a header using the warning control pragma. For
+ example:</p>
+
+ <pre class="c++">
+#include &lt;odb/core.hxx>
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunknown-pragmas"
+
+#pragma db object
+class person
+{
+ ...
+
+ #pragma db id
+ unsigned long id_;
+};
+
+#pragma clang diagnostic pop
+ </pre>
+
<!-- PART -->