balazske added a comment.

Function `mkdir` is modeled incorrectly by the checker. According to the man 
page it can return 0 or -1 only (-1 is error) but the checker allows 
non-negative value at success. So the shown bug report is incorrect (it can be 
only -1 if not 0 and then check of `errno` is allowed). Anyway the note tags 
should be added to every function.



================
Comment at: 
clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1697
+            .Case(ReturnsValidFileDescriptor, ErrnoMustNotBeChecked, "OK")
+            .Case(ReturnsMinusOne, ErrnoNEZeroIrrelevant, "'dup2' failed")
             .ArgConstraint(ArgumentCondition(0, WithinRange, Range(0, IntMax)))
----------------
These strings are for test purposes only.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125400

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

Reply via email to