[PATCH] D157188: [clang-tidy] Add bugprone-allocation-bool-conversion

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 6 07:48:49 PDT 2023


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/AllocationBoolConversionCheck.cpp:25
+                      "malloc;calloc;realloc;strdup;fopen;fdopen;freopen;"
+                      "opendir;fdopendir;popen;mmap;allocate"))) {}
+
----------------
POSIX `open`, `openat`, `creat`, `pthread_create` should be added too.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/AllocationBoolConversionCheck.cpp:60
+         "result of the 'new' expression is being used as a boolean value, "
+         "which "
+         "may lead to unintended behavior or resource leaks");
----------------
Should be merged together.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157188



More information about the cfe-commits mailing list