[PATCH] D80018: [Analyzer][StreamChecker] Added check for "indeterminate file position".

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 15 09:45:18 PDT 2020


balazske created this revision.
Herald added subscribers: cfe-commits, ASDenysPetrov, martong, Charusso, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun.
Herald added a reviewer: Szelethus.
Herald added a project: clang.

According to the standard, after a `wread` or `fwrite` call the file position
becomes "indeterminate". It is assumable that a next read or write causes
undefined behavior, so a (fatal error) warning is added for this case.
The indeterminate position can be cleared by some operations, for example
`fseek` or `freopen`, not with `clearerr`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80018

Files:
  clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
  clang/test/Analysis/stream-error.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80018.264265.patch
Type: text/x-patch
Size: 10224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200515/05bf4390/attachment.bin>


More information about the cfe-commits mailing list