[clang] [clang][analyzer] Improve modeling of `fileno` in the StreamChecker (PR #76207)

2023-12-22 Thread Ben Shi via cfe-commits
https://github.com/benshi001 closed https://github.com/llvm/llvm-project/pull/76207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Improve modeling of `fileno` in the StreamChecker (PR #76207)

2023-12-22 Thread Balázs Kéri via cfe-commits
balazske wrote: I do not see much benefit of adding `fileno` to the checker in the current state. If the `StdLibraryFunctionsChecker` is turned on it will anyway do a similar modeling of `fileno` (this applied to `ftell` too). The `fileno` and `ftell` are semantically different and `fileno`

[clang] [clang][analyzer] Improve modeling of `fileno` in the StreamChecker (PR #76207)

2023-12-21 Thread Ben Shi via cfe-commits
https://github.com/benshi001 updated https://github.com/llvm/llvm-project/pull/76207 >From 0a46fedc497a124d3aca4295b8c18ae60df186e9 Mon Sep 17 00:00:00 2001 From: Ben Shi Date: Fri, 22 Dec 2023 14:47:48 +0800 Subject: [PATCH] [clang][analyzer] Improve modeling of `fileno` in the StreamChecker

[clang] [clang][analyzer] Improve modeling of `fileno` in the StreamChecker (PR #76207)

2023-12-21 Thread Ben Shi via cfe-commits
benshi001 wrote: The reported format error is in another file, not related to my patch. https://github.com/llvm/llvm-project/pull/76207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][analyzer] Improve modeling of `fileno` in the StreamChecker (PR #76207)

2023-12-21 Thread Ben Shi via cfe-commits
benshi001 wrote: `fileno` and `ftell` are quite similar, 1. both of them return `0` on success, and `-1` on failure. 2. both of them set `errno` on failure. The differences are 1. `fileno` returns `int` type but `ftell` returns `long` type. 2. `ftell` will not affect the value of `error` on

[clang] [clang][analyzer] Improve modeling of `fileno` in the StreamChecker (PR #76207)

2023-12-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Ben Shi (benshi001) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/76207.diff 3 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp (+19-11) - (modified)

[clang] [clang][analyzer] Improve modeling of `fileno` in the StreamChecker (PR #76207)

2023-12-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Ben Shi (benshi001) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/76207.diff 3 Files Affected: - (modified) clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp (+19-11) - (modified)

[clang] [clang][analyzer] Improve modeling of `fileno` in the StreamChecker (PR #76207)

2023-12-21 Thread Ben Shi via cfe-commits
https://github.com/benshi001 created https://github.com/llvm/llvm-project/pull/76207 None >From a7fed7e081981b1c7c6c41dd72f0bc0736260754 Mon Sep 17 00:00:00 2001 From: Ben Shi Date: Fri, 22 Dec 2023 14:47:48 +0800 Subject: [PATCH] [clang][analyzer] Improve modeling of `fileno` in the