[cfe-dev] Warning at always true condition

David Blaikie dblaikie at gmail.com
Tue Jun 12 09:49:59 PDT 2012


On Mon, Jun 11, 2012 at 4:10 AM, Devchandra L Meetei <dlmeetei at gmail.com> wrote:
> Hi All
> Does clang support any switch to warn about a conditional eg in if(p* !='h'
> || p* !='H'), which is always true.

I don't believe Clang (as a compiler anyway - as Sean mentioned, it
might be in the Static Analyzer, but even then I suspect not) has such
a warning. You could file a bug about it, but the real challenge will
be trying to get the noise down to an acceptable level to include this
warning in Clang. If you can provide examples of real bugs that such a
diagnostic would have found & include those details in the bug that'd
be really helpful.

Thanks,
- David



More information about the cfe-dev mailing list