]> granicus.if.org Git - clang/commitdiff
Add CSS style for FAQ questions, and restate FAQ questions as actual questions.
authorTed Kremenek <kremenek@apple.com>
Sat, 9 Jun 2012 20:10:45 +0000 (20:10 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 9 Jun 2012 20:10:45 +0000 (20:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158282 91177308-0d34-0410-b5e6-96231b3b80d8

www/analyzer/content.css
www/analyzer/faq.html

index b22cca9ff55e08c716fdeec500b2e9cd1614657d..6a1cfe7198edaa18c59f58343209380252af76b9 100644 (file)
@@ -15,6 +15,11 @@ h1 { padding-top:0px; margin-top:0px;}
 h2 { color:#333333; padding-top:0.5em; }
 h3 { padding-top: 0.5em; margin-bottom: -0.25em; color:#2d58b7 }
 h4 { color:#2d58b7 }
+h4.faq { margin-top:4em;
+         color:black;
+         border-width:1px; border-style:solid;
+         border-color:#cccccc; 
+         background-color:#eeeeee; padding:10px }
 li { padding-bottom: 0.5em }
 ul { padding-left:1.5em; }
 
index 1859e78926278067b056470b1829349be75f7e89..94e4d279238e9d22024367a87cdaabf1dfa42b44 100644 (file)
@@ -7,7 +7,7 @@
   <link type="text/css" rel="stylesheet" href="content.css">
   <script type="text/javascript" src="scripts/menu.js"></script>
   <style type="text/css">
-  tr:first-child { width:20%; }
+    tr:first-child { width:20%; }
   </style>
 </head>
 <body>
 
 <h1>FAQ and How to Deal with Common False Positives</h1>
 
-<h4>Q: The analyzer reports a bug on an error path. I do not want the bug being reported here since my custom error handler will safely end the execution before the bug is reached.</h4>
+<h4 class="faq">Q: How do I tell the analyzer that I do not want the bug being
+reported here since my custom error handler will safely end the execution before
+the bug is reached?</h4>
 
 <img src="images/example_custom_assert.png" alt="example custom assert">
 
 <p>You can tell the analyzer that this path is unreachable by teaching it about your <a href = "annotations.html#custom_assertions" >custom assertion handlers</a>.</p>
 
-<h4>Q: The analyzer reports "Dereference of null pointer", but I know that the pointer is never null.</h4>
+<h4 class="faq">Q: The analyzer reports a null dereference, but I know that the
+pointer is never null. How can I tell the analyzer that a pointer can never be
+null?</h4>
 
 <img src="images/example_null_pointer.png" alt="example null pointer">
 
-<p>The reason the analyzer often thinks that a pointer can be null is because the preceding code checked compared it against null. So if you are absolutely sure that it cannot be null, remove the preceding check and, preferably, add an assert as well. For example, in the code segment above, it will be sufficient to remove the <tt>if (!b)</tt> check. </p>
+<p>The reason the analyzer often thinks that a pointer can be null is because the preceding code checked compared it against null. So if you are absolutely sure that it cannot be null, remove the preceding check and, preferably, add an assertion as well. For example, in the code segment above, it will be sufficient to remove the <tt>if (!b)</tt> check. </p>
 
-<h4>Q: The analyzer assumes that the loop body is never entered, which can never happen in this code.</h4>
+<h4 class="faq">Q: The analyzer assumes that a loop body is never entered.  How can I tell it that the loop body will be entered at least once?</h4>
 
 <img src="images/example_use_assert.png" alt="example use assert">
 
-<p>You can teach the analyzer facts about your code as well as document it by using asserts. In the contrived example above, the analyzer reports an error on the path which assumes that the loop is never entered. However, the owner of the code might know that the loop is always entered because the input parameter <tt>length</tt> is always greater than <tt>0</tt>. The false positive can be suppressed by asserting this knowledge, adding <tt>assert(length > 0)</tt> in the beginning of the function.</p>
+<p>You can teach the analyzer facts about your code as well as document it by
+using assertions. In the contrived example above, the analyzer reports an error
+on the path which assumes that the loop is never entered. However, the owner of
+the code might know that the loop is always entered because the input parameter
+<tt>length</tt> is always greater than <tt>0</tt>. The false positive can be
+suppressed by asserting this knowledge, adding <tt>assert(length > 0)</tt> in
+the beginning of the function.</p>
 
-<h4>Q: How can I suppress the analyzer warning?</h4>
+<h4 class="faq">Q: How can I suppress a specific analyzer warning?</h4>
 
 <img src="images/example_null_pointer.png" alt="example null pointer">