The stream handling functions ftell, rewind, fgetpos, fsetpos
are evaluated in the checker more exactly than before.
New tests are added to test behavior of the checker together with
StdLibraryFunctionsChecker. The option ModelPOSIX of that checker
affects if (most of) the stream functions are recognized, and checker
StdLibraryFunctionArgs generates warnings if constraints for arguments
are not satisfied. The state of errno is set by StdLibraryFunctionsChecker
too for every case in the stream functions.
StreamChecker works with the stream state only, does not set the errno state,
and is not dependent on other checkers.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Does this patch fix any false positives from before, or is this just all new stuff? I ask, because I wonder whats the shortest path towards popping these checkers out of alpha, and fix what we already have. By no means am I saying that we should postpone landing this, but take a more directed attempt at tying off loose ends after this stack.
clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp | ||
---|---|---|
952 | Why the comment? Seems like its solely StdLibraryFunctionChecker's job to handle errno. | |
979 | Same. | |
clang/test/Analysis/stream-errno-note.c | ||
1–2 | Can you break this line up, such that we have an -analyzer-checker= argument for each package/checker? |
Mostly LGTM, but I see that you have tests for the predecessor patch here as well, so I'll accept both at once.
clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp | ||
---|---|---|
89 | When can this occur? |
clang-format not found in user’s local PATH; not linting file.