[clang] [clang][analyzer] Change modeling of 'fileno' in checkers. (PR #81842)
Ben Shi via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 20 17:21:32 PST 2024
=?utf-8?q?Bal=C3=A1zs_K=C3=A9ri?= <balazs.keri at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/81842 at github.com>
================
@@ -268,6 +268,16 @@ void test_clearerr(FILE *F) {
// expected-warning at -1{{FALSE}}
}
+void test_fileno(FILE *F) {
+ errno = 0;
+ int A = fileno(F);
+ clang_analyzer_eval(F != NULL); // expected-warning{{TRUE}}
+ clang_analyzer_eval(A >= 0); // expected-warning{{TRUE}}
----------------
benshi001 wrote:
It looks better to making the comment lines begin from the same column.
https://github.com/llvm/llvm-project/pull/81842
More information about the cfe-commits
mailing list