[PATCH] D28729: [clang-tidy] Add -enable-alpha-checks command

Piotr Padlewski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 14 15:11:44 PST 2017


Prazek added a comment.

So the problem I got is that every time I want to check if there is already a feature in clang-tidy/static-analyzer that solves my issue, I either have to deal with static-analyzer command line, which is horrible, or I have to modify and recompile the source code.

The case I was looking at is a check to find

  int *p = g():
  *p = 42;
  if(!p) {g(): }

I wanted to find null checks after the pointer was dereferenced, and indeed I found it in deadcode or unreachable code analysis in static-analyzer.

I am not sure what you are afraid of - as long as this feature is not turned by default everything should be fine. If someone would turn it on then as long as he doesn't see any false positives then everything is still fine, and it can always disable flag.

AFAIK there is a way to specify in cl::opt that the option is hidden, which could probably solve your concerns?


https://reviews.llvm.org/D28729





More information about the cfe-commits mailing list