Author: kremenek
Date: Sat Jun 9 15:10:45 2012
New Revision: 158282
URL: http://llvm.org/viewvc/llvm-project?rev=158282&view=rev
Log:
Add CSS style for FAQ questions, and restate FAQ questions as actual questions.
Modified:
cfe/trunk/www/analyzer/content.css
cfe/trunk/www/analyzer/faq.html
Modified: cfe/trunk/www/analyzer/content.css
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/content.css?rev=158282&r1=158281&r2=158282&view=diff
==============================================================================
--- cfe/trunk/www/analyzer/content.css (original)
+++ cfe/trunk/www/analyzer/content.css Sat Jun 9 15:10:45 2012
@@ -15,6 +15,11 @@
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; }
Modified: cfe/trunk/www/analyzer/faq.html
URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/faq.html?rev=158282&r1=158281&r2=158282&view=diff
==============================================================================
--- cfe/trunk/www/analyzer/faq.html (original)
+++ cfe/trunk/www/analyzer/faq.html Sat Jun 9 15:10:45 2012
@@ -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>
@@ -19,25 +19,35 @@
<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">
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits