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

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 14 06:40:26 PDT 2020


Szelethus marked an inline comment as done.
Szelethus 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) {
----------------
martong wrote:
> 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.
Yes, but copy assignment happens because out optional isn't optimal (hehe) http://lists.llvm.org/pipermail/cfe-dev/2018-July/058427.html. Anyways, it is what it is. You could add a comment about this, but it might not be worthwhile. 


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


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