r222009 - [Sema]. Warn when logical expression is a pointer
fjahanian at apple.com
Mon Nov 17 10:01:07 PST 2014
> On Nov 17, 2014, at 7:18 AM, Timur Iskhodzhanov <timurrrr at google.com> wrote:
> This has broken our -Werror internal build.
> One specific thing that I consider a [noisy] false positive:
> #define MY_ASSERT(cond) ((cond)? (void)0 : blah)
> #define BUG(description) MY_ASSERT(!description)
> if (some_condition)
> BUG("oh this is broken")
I cannot reproduce this warning. This is the test I used:
#define MY_ASSERT(cond) ((cond)? (void)0 : (void)1)
#define BUG(description) MY_ASSERT(!description)
void foo (int some_condition)
BUG("oh this is broken");
Can you give a test case producing the warning?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits