[PATCH] D45601: Warn on bool* to bool conversion

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 13 05:36:51 PDT 2018


aaron.ballman added a reviewer: aaron.ballman.
aaron.ballman added a comment.

I'd also be interested to see the number of false positives and true positives when run over some large code bases (both C and C++). For instance, I would imagine code like this to be somewhat common and very reasonable:

  void some_func(int someArg, bool *someResult) {
    if (someResult)
      *someResult = false;
  }

Especially in C code where references are not available. This makes me wary of making this a compiler diagnostic, but clang-tidy may still be a reasonable place for this functionality to live.


https://reviews.llvm.org/D45601





More information about the cfe-commits mailing list