[PATCH] D33365: [clang-tidy] misc-assertion-count: A New Check

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 8 01:23:53 PDT 2017


alexfh requested changes to this revision.
alexfh added a comment.
This revision now requires changes to proceed.

I guess, this check should go to `readability` or elsewhere, but definitely not to `misc`.

Another big question is whether it's reasonable to set up specific ratio limits on the density of asserts. I think, density of asserts strongly depends on the nature of the code, and there is no single answer to how much asserts should be used. IIUC, neither of the recommendations you mentioned contain any quantitative measures, they just delegate the decision to the developer. I'm not saying it's impossible to find good formalization of these rules, but I'd expect some sort of analysis of existing codebases with regard to how asserts are used (not just the density of asserts, but also positioning of asserts and what is being checked by the asserts) in different types of code.


Repository:
  rL LLVM

https://reviews.llvm.org/D33365





More information about the cfe-commits mailing list