From: George Burgess IV Date: Tue, 21 Jun 2016 02:19:43 +0000 (+0000) Subject: [Docs] More warning fixes to unbreak the docs buildbot. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d29e48887df01ee66459726d979b7322d38bfcd;p=clang [Docs] More warning fixes to unbreak the docs buildbot. A number of warnings still remain, but these were the last of the "unlexable code"-related ones (AFAICT). I changed a few examples in docs/UsersManual.rst to showcase -Wextra-tokens because it's already documented (-Wmultichar isn't), and the sphinx C lexer apparently can't handle char literals like 'ab'. It seemed like a better overall approach than just marking the code blocks as none or console. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273232 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/SourceBasedCodeCoverage.rst b/docs/SourceBasedCodeCoverage.rst index 95b2eb692b..b255bd771e 100644 --- a/docs/SourceBasedCodeCoverage.rst +++ b/docs/SourceBasedCodeCoverage.rst @@ -123,7 +123,7 @@ distinct views for ``foo(...)`` and ``foo(...)``. If ``-show-line-counts-or-regions`` is enabled, ``llvm-cov`` displays sub-line region counts (even in macro expansions): -.. code-block:: cpp +.. code-block:: none 20| 1|#define BAR(x) ((x) || (x)) ^20 ^2 diff --git a/docs/ThreadSanitizer.rst b/docs/ThreadSanitizer.rst index 0b9b163a96..cfb0a952e1 100644 --- a/docs/ThreadSanitizer.rst +++ b/docs/ThreadSanitizer.rst @@ -30,7 +30,7 @@ and line numbers in the warning messages. Example: -.. code-block:: c++ +.. code-block:: console % cat projects/compiler-rt/lib/tsan/lit_tests/tiny_race.c #include diff --git a/docs/UsersManual.rst b/docs/UsersManual.rst index 64ae4661d2..945dc53c4e 100644 --- a/docs/UsersManual.rst +++ b/docs/UsersManual.rst @@ -711,16 +711,19 @@ also allows you to push and pop the current warning state. This is particularly useful when writing a header file that will be compiled by other people, because you don't know what warning flags they build with. -In the below example :option:`-Wmultichar` is ignored for only a single line of -code, after which the diagnostics return to whatever state had previously +In the below example :option:`-Wextra-tokens` is ignored for only a single line +of code, after which the diagnostics return to whatever state had previously existed. .. code-block:: c - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wmultichar" + #if foo + #endif foo // warning: extra tokens at end of #endif directive - char b = 'df'; // no warning. + #pragma clang diagnostic ignored "-Wextra-tokens" + + #if foo + #endif foo // no warning #pragma clang diagnostic pop @@ -772,11 +775,13 @@ the pragma onwards within the same file. .. code-block:: c - char a = 'xy'; // warning + #if foo + #endif foo // warning: extra tokens at end of #endif directive #pragma clang system_header - char b = 'ab'; // no warning + #if foo + #endif foo // no warning The :option:`--system-header-prefix=` and :option:`--no-system-header-prefix=` command-line arguments can be used to override whether subsets of an include