[PATCH] D83407: [analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 9 01:20:23 PDT 2020


balazske added a comment.

Are not some functions missing from the list (`shutdown`, `sockatmark`, `socket`) (these come from //<sys/socket.h>//)? And `getnameinfo` comes from //<netdb.h>// with many other functions that are not added.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1722
+          ACtx.getPointerType(StructSockaddrTy->withConst());
+      StructSockaddrPtrRestrictTy =
+          ACtx.getLangOpts().C99 ? ACtx.getRestrictType(*StructSockaddrPtrTy)
----------------
There could be a generic form of getting the restrict type for a type so something like this can be done (this is used relatively often):
`getRestrictTypeIfApplicable(ACtx, StructSockaddrPtrTy)`



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83407





More information about the cfe-commits mailing list