martong added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:356
+    State = State->set<StreamMap>(
+        StreamSym, StreamState{SS->K, false, SS->ShouldCallFerror});
+  }
----------------
Maybe adding a comment like `false /*Feof*/` could make this more readable. 
Even better, using two different strong types instead of the bool args could 
make it even more safe, but if that's too much hassle then it is may be not 
worth (I don't know if LLVM has a proper infrastructure for strong types).


================
Comment at: clang/test/Analysis/stream.c:182
+
+void check_fgetc_error() {
+  FILE *fp = fopen("foo.c", "r");
----------------
Do you have tests for `getc` as well? Maybe we could have at least one for getc 
too.


================
Comment at: clang/test/Analysis/stream.c:218
+    feof(fp);
+    fclose(fp); // expected-warning {{Should call}}
+  }
----------------
Perhaps `Should call ferror` is more informative for the readers of the tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75045



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

Reply via email to