This is an archive of the discontinued LLVM Phabricator instance.

[Analyzer] Improve report of "indeterminate file position" condition (alpha.unix.Stream).
AbandonedPublic

Authored by balazske on Jun 27 2021, 11:55 PM.

Details

Summary

The checker warns if specific stream operation is called in a failed state
(that is called "indeterminate file position condition").
The commit adds indication of location of the previously failed operation
that causes the failed state.

Diff Detail

Event Timeline

balazske created this revision.Jun 27 2021, 11:55 PM
balazske requested review of this revision.Jun 27 2021, 11:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2021, 11:55 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I suppose the counter is outdated, similarly to D104925#2850420?

clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
101–109

Shouldn't this be all you need to retrieve the fact that the streams position is indeterminate?

This will be rebased on D104925 when that is finished.

clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
101–109

The "problem" can be that the error state can contain a combination of errors, this means FEOF and FERROR together. In this case the "indeterminate" is just not applicable to the FEOF state.

balazske abandoned this revision.Aug 3 2021, 1:06 AM

Adding this functionality is continued in D106262.