balazske added a comment.

Some explanation of the error states:

- `EofError` indicates an EOF condition in the stream.
- `OtherError` indicates a generic (I/O or other but not EOF) error.
- `AnyError` is a "placeholder" if the exact error kind is not important. This 
is a "Schrödinger's cat" type of state: If we need to observe the exact error 
it can change to Eof or Other error. (See code in `evalFeof` and `evalFerror`, 
probably this is the only place for this event.) This error kind is used to 
save state splits, other solution is to make for example after fseek a new 
state for `EofError` and another for `OtherError`. The file error functions are 
relatively seldomly used (?), because checking success of an operation can be 
done with the return value and there is no need to check `ferror` or `feof`. 
And for analyzer warnings it is often enough to know if any error happened, not 
if exactly **EOF** or other error.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75682



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to