diff options
Diffstat (limited to 'docs/UsersManual.html')
-rw-r--r-- | docs/UsersManual.html | 54 |
1 files changed, 49 insertions, 5 deletions
diff --git a/docs/UsersManual.html b/docs/UsersManual.html index 51e699f..7524161 100644 --- a/docs/UsersManual.html +++ b/docs/UsersManual.html @@ -39,6 +39,7 @@ td { <li><a href="#diagnostics_categories">Diagnostic Categories</a></li> <li><a href="#diagnostics_commandline">Controlling Diagnostics via Command Line Flags</a></li> <li><a href="#diagnostics_pragmas">Controlling Diagnostics via Pragmas</a></li> + <li><a href="#analyzer_diagnositics">Controlling Static Analyzer Diagnostics</a></li> </ul> <li><a href="#precompiledheaders">Precompiled Headers</a></li> <li><a href="#codegen">Controlling Code Generation</a></li> @@ -358,6 +359,18 @@ exprs.c:47:15:{47:8-47:14}{47:17-47:24}: error: invalid operands to binary expre <p>The {}'s are generated by -fdiagnostics-print-source-range-info.</p> </dd> +<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +<dt id="opt_fdiagnostics-parseable-fixits"> +<b>-fdiagnostics-parseable-fixits</b>: +Print Fix-Its in a machine parseable form.</dt> +<dd><p>This option makes Clang print available Fix-Its in a machine parseable format at the end of diagnostics. The following example illustrates the format:</p> + +<pre> + fix-it:"t.cpp":{7:25-7:29}:"Gamma" +</pre> + +<p>The range printed is a half-open range, so in this example the characters at column 25 up to but not including column 29 on line 7 in t.cpp should be replaced with the string "Gamma". Either the range or the replacement string may be empty (representing strict insertions and strict erasures, respectively). Both the file name and the insertion string escape backslash (as "\\"), tabs (as "\t"), newlines (as "\n"), double quotes(as "\"") and non-printable characters (as octal "\xxx").</p> +</dd> </dl> @@ -579,6 +592,42 @@ GCC do not support the exact same set of warnings, so even when using GCC compatible #pragmas there is no guarantee that they will have identical behaviour on both compilers. </p> +<h4 id="analyzer_diagnositics">Controlling Static Analyzer Diagnostics</h4> + +<p>While not strictly part of the compiler, the diagnostics from Clang's <a +href="http://clang-analyzer.llvm.org">static analyzer</a> can also be influenced +by the user via changes to the source code. This can be done in two ways: + +<ul> + +<li id="analyzer_annotations"><b>Annotations</b>: The static analyzer recognizes various GCC-style +attributes (e.g., <tt>__attribute__((nonnull)))</tt>) that can either suppress +static analyzer warnings or teach the analyzer about code invariants which +enable it to find more bugs. While many of these attributes are standard GCC +attributes, additional ones have added to Clang to specifically support the +static analyzer. Detailed information on these annotations can be found in the +<a href="http://clang-analyzer.llvm.org/annotations.html">analyzer's +documentation</a>.</li> + +<li><b><tt>__clang_analyzer__</tt></b>: When the static analyzer is using Clang +to parse source files, it implicitly defines the preprocessor macro +<tt>__clang_analyzer__</tt>. While discouraged, code can use this macro to +selectively exclude code the analyzer examines. Here is an example: + +<pre> +#ifndef __clang_analyzer__ +// Code not to be analyzed +#endif +</pre> + +In general, this usage is discouraged. Instead, we prefer that users file bugs +against the analyzer when it flags false positives. There is also active +discussion of allowing users in the future to selectively silence specific +analyzer warnings (some which can already be done using <a +href="analyzer_annotations">annotations</a>).</li> + +</ul> + <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> <h3 id="precompiledheaders">Precompiled Headers</h3> <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = --> @@ -789,11 +838,6 @@ soon.</li> the uses described in the bug, this is likely to be implemented at some point, at least partially.</li> -<li>clang does not support #pragma align -(<a href="http://llvm.org/bugs/show_bug.cgi?id=3811">bug 3811</a>). This is a -relatively small feature, so it is likely to be implemented relatively -soon.</li> - <li>clang does not support code generation for local variables pinned to registers (<a href="http://llvm.org/bugs/show_bug.cgi?id=3933">bug 3933</a>). This is a relatively small feature, so it is likely to be implemented |