martong marked 3 inline comments as done. martong added a comment. Thanks for the review!
================ Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1367-1368 + .Case(ReturnsZeroOrMinusOne) .ArgConstraint(ArgumentCondition( 0, WithinRange, Range(0, IntMax)))); ---------------- steakhal wrote: > I think you should hoist this ArgumentCondition construction with a lambda > call. It would lead to more readable summaries. > > ```lang=c++ > const auto ValidFileDescriptorArgAt = [](unsigned ArgIdx) { > return ArgumentCondition(ArgIdx, WithinRange, Range(0, IntMax)))); > }; > ``` > Probably the very same principle would apply for handling `off_t` arguments. > > You can probably find a better name, but you get the idea. > If you agree on this, you could create a follow-up patch. Good idea, thanks! I am going to create another patch for this (and another for exec* functions). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92771/new/ https://reviews.llvm.org/D92771 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits