[PATCH] D71001: [clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 16 06:04:42 PST 2020


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-pointer-arithmetic-in-alloc.rst:15
+
+    void bad_malloc(int n) {
+      char *p = (char*) malloc(n) + 10;
----------------
Identification. I think 2 character should be enough.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-pointer-arithmetic-in-alloc.rst:25
+
+      char *p = (char*) malloc(n + 10);
----------------
Identification. I think 2 character should be enough.


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

https://reviews.llvm.org/D71001





More information about the cfe-commits mailing list