r205667 - [analyzer] Add an ErrnoChecker (PR18701) to the Potential Checkers list.
Jordan Rose
jordan_rose at apple.com
Fri Apr 4 23:10:28 PDT 2014
Author: jrose
Date: Sat Apr 5 01:10:28 2014
New Revision: 205667
URL: http://llvm.org/viewvc/llvm-project?rev=205667&view=rev
Log:
[analyzer] Add an ErrnoChecker (PR18701) to the Potential Checkers list.
Modified:
cfe/trunk/www/analyzer/potential_checkers.html
Modified: cfe/trunk/www/analyzer/potential_checkers.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/potential_checkers.html?rev=205667&r1=205666&r2=205667&view=diff
==============================================================================
--- cfe/trunk/www/analyzer/potential_checkers.html (original)
+++ cfe/trunk/www/analyzer/potential_checkers.html Sat Apr 5 01:10:28 2014
@@ -314,6 +314,34 @@ int foo(bool cond) {
</table>
+<!-- =============================== POSIX ================================= -->
+<h3>POSIX</h3>
+<table class="checkers">
+<col class="namedescr"><col class="example"><col class="progress">
+<thead><tr><td>Name, Description</td><td>Example</td><td>Progress</td></tr></thead>
+
+<tr><td><span class="name">posix.Errno</span><br><br>
+Record that <code>errno</code> is non-zero when certain functions fail.
+</td><td><pre>
+#include <stdlib.h>
+
+int readWrapper(int fd, int *count) {
+ int lcount = read(fd, globalBuf, sizeof(globalBuf));
+ if (lcount < 0)
+ return errno;
+ *count = lcount;
+ return 0;
+}
+
+void use(int fd) {
+ int count;
+ if (!readWrapper(fd))
+ print("%d", count); // should not warn
+}
+</pre></td><td class="aligned"><a href="http://llvm.org/bugs/show_bug.cgi?id=18701">PR18701</a></td></tr>
+
+</table>
+
<!-- ========================= undefined behavior ========================== -->
<h3>undefined behavior</h3>
<table class="checkers">
More information about the cfe-commits
mailing list