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

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 16 08:35:57 PDT 2021


balazske added a comment.

This will be rebased on D104925 <https://reviews.llvm.org/D104925> when that is finished.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:101-109
   /// Indicate if the file has an "indeterminate file position indicator".
   /// This can be set at a failing read or write or seek operation.
   /// If it is set no more read or write is allowed.
   /// This value is not dependent on the stream error flags:
   /// The error flag may be cleared with `clearerr` but the file position
   /// remains still indeterminate.
   /// This value applies to all error states in ErrorState except FEOF.
----------------
Szelethus wrote:
> Shouldn't this be all you need to retrieve the fact that the streams position is indeterminate?
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105003/new/

https://reviews.llvm.org/D105003



More information about the cfe-commits mailing list