[PATCH] D84248: [analyzer][StdLibraryFunctionsChecker] Add POSIX time handling functions

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 12 09:14:44 PDT 2020


balazske added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:2040
+
+    if (ConstStructTimevalPtrTy && StructTimespecPtrTy)
+      // int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
----------------
Should be `ConstStructTimespecPtrTy`.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:2092
+              .ArgConstraint(NotNull(ArgNo(0)))
+              .ArgConstraint(NotNull(ArgNo(1))));
+
----------------
Is it possible to check for the size of the passed buffer? The man page says that `buf` should have room for 26 bytes (for `ctime_r` too).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84248



More information about the cfe-commits mailing list