diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual.xhtml | 35 |
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 <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 --> |