]> granicus.if.org Git - clang/commitdiff
[Docs] More warning fixes to unbreak the docs buildbot.
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Tue, 21 Jun 2016 02:19:43 +0000 (02:19 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Tue, 21 Jun 2016 02:19:43 +0000 (02:19 +0000)
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

docs/SourceBasedCodeCoverage.rst
docs/ThreadSanitizer.rst
docs/UsersManual.rst

index 95b2eb692bad7e2f3f039f3a2ab5ff7aac008d38..b255bd771e368be08c7fe2c2ad4e22f0f5a62ddb 100644 (file)
@@ -123,7 +123,7 @@ distinct views for ``foo<int>(...)`` and ``foo<float>(...)``.  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
index 0b9b163a9651500fe3a5267d4caca23e81815ebb..cfb0a952e12e0e532f41e895163db0a48845a58d 100644 (file)
@@ -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 <pthread.h>
index 64ae4661d2b0acbf99ec86bc8859ea15b54d4aae..945dc53c4e7e18c96f9b4f2ce39416339b300bb9 100644 (file)
@@ -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