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

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 10 07:33:49 PDT 2020


martong marked 2 inline comments as done.
martong added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:328-329
   struct Signature {
-    const ArgTypes ArgTys;
-    const QualType RetTy;
+    ArgTypes ArgTys;
+    QualType RetTy;
     Signature(ArgTypes ArgTys, QualType RetTy) : ArgTys(ArgTys), RetTy(RetTy) {
----------------
Szelethus wrote:
> Ah right, because we need to copy this. Shame that `Optional` can't just inplace construct the object with a copy constructor or something.
The problem is rather with the copy assignment. I think, copy construction could be implemented if we keep the `const`, but assignment is not.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp:1746
+    if (StructSockaddrPtrRestrictTy && Socklen_tPtrRestrictTy) {
+      auto Accept = Summary(NoEvalCall)
+                        .ArgConstraint(ArgumentCondition(0, WithinRange,
----------------
Szelethus wrote:
> `AcceptSummary`?
I prefer simply `Accept` because right after the `=` sign we have the `Summary` string :)


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