[clang] [clang][analyzer] Fix StreamChecker `ftell` and `fgetpos` at indeterminate file position. (PR #84191)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 01:01:08 PST 2024


================
@@ -880,6 +883,24 @@ void StreamChecker::preReadWrite(const FnDescription *Desc,
   }
 }
 
+void StreamChecker::preWrite(const FnDescription *Desc, const CallEvent &Call,
----------------
steakhal wrote:

Let me share my experience with `std::bind` and with this checker.
Unfortunately, we also have/had a couple (<10) conflicting patches to this checker, and I had to rebase 16 times to clang-18. This is fine, but when I this many `std::binds`, and sometimes changes where the railing "bool" flag meaning was changed, I really had to be on my toes when resolving syntactic & semantic conflicts.
I feel the `std::bind` usage got out of hand here, and I now regret not pushing back.

The bottom line is, that I think having dedicated handlers dispatching to common implementations, or just copy-pasting their implementation while specializing it leads to cleaner code than using `std::bind` and directly binding to the generic implementation.

https://github.com/llvm/llvm-project/pull/84191


More information about the cfe-commits mailing list