[PATCH] D104925: [Analyzer] Improve report of file read at end-of-file condition.
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 30 06:20:44 PDT 2021
martong added a comment.
+1 for note tags.
================
Comment at: clang/test/Analysis/stream-note.c:134
+
+void check_eof_notes_3() {
+ FILE *F;
----------------
Perhaps we could have some more explanatory test case names. I mean how _3 is different than _2? What is the case each of them exactly tests?
================
Comment at: clang/test/Analysis/stream-note.c:141
+ int RRet = fread(Buf, 1, 1, F); // expected-note {{Assuming that stream reaches end-of-file here}}
+ if (ferror(F)) { // expected-note {{End-of-file status is discovered here}} expected-note {{Taking false branch}}
+ } else {
----------------
Strictly speaking it is not necessarily and end-of-file status, `ferror` indicates if there was an error.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104925/new/
https://reviews.llvm.org/D104925
More information about the cfe-commits
mailing list