[PATCH] D140968: [clang-tidy] Add check for passing the result of `std::string::c_str` to `strlen`
Carlos Galvez via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 4 07:32:09 PST 2023
carlosgalvezp added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/readability/StrlenStringCStrCheck.h:23
+ : ClangTidyCheck(Name, Context),
+ EnableForDataMethod(Options.get("EnableForDataMethod", false)) {}
+
----------------
The docs say this is "true" by default, but here you are setting it to false.
================
Comment at: clang-tools-extra/docs/clang-tidy/checks/readability/strlen-string-cstr.rst:24
+
+.. option:: EnableForDataMethod
+
----------------
Is there a use case for wanting this option? (As opposed to unconditionally warning about data()) The problem is the same and the same fix applies?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140968/new/
https://reviews.llvm.org/D140968
More information about the cfe-commits
mailing list