diff options
author | Jordan Rose <jordan_rose@apple.com> | 2014-04-05 06:10:28 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2014-04-05 06:10:28 +0000 |
commit | b2887d4c99917625f6361f0faa386fe064c3b31c (patch) | |
tree | 30e02d8a03699b1c28ab3df3f59972911f855c76 /www | |
parent | 333e7cfe8f338a367941c6423ffc10eda8893028 (diff) | |
download | clang-b2887d4c99917625f6361f0faa386fe064c3b31c.tar.gz clang-b2887d4c99917625f6361f0faa386fe064c3b31c.tar.bz2 clang-b2887d4c99917625f6361f0faa386fe064c3b31c.tar.xz |
[analyzer] Add an ErrnoChecker (PR18701) to the Potential Checkers list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'www')
-rw-r--r-- | www/analyzer/potential_checkers.html | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/www/analyzer/potential_checkers.html b/www/analyzer/potential_checkers.html index 5b32dd0329..6ec68a9909 100644 --- a/www/analyzer/potential_checkers.html +++ b/www/analyzer/potential_checkers.html @@ -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"> |