Some file and directory related functions have an integer file descriptor argument
that can be a valid file descriptor or a special value AT_FDCWD. This value is
relatively often used in open source projects and is usually defined as a negative
number, and the checker reports false warnings (a valid file descriptor is not
negative) if this fix is not included.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp | ||
---|---|---|
1530–1542 | ||
2142–2143 | I think I would recommend hoisting this common subexpression. This would save repetition on subsequent occurrences. const auto ValidDescriptorOrAtCWDRange = Range({AT_FDCWDv, AT_FDCWDv}, {0, IntMax}); You can explore if hoisting the whole ArgumentCondition would make it even more readable. |
clang-format not found in user’s local PATH; not linting file.