patch for warning on logical negation with known result

jahanian fjahanian at
Thu Oct 23 10:24:47 PDT 2014

I would like to warn on logical negation of operands with known non-null value; as in "if (!array)…", just as we warn on "if (array == 0)…"
Note that this is a c-only patch. c++ already has a warning when such non-null pointers are implicitly converted to bool. 
Is this ok for check-in?

- Fariborz

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <>

More information about the cfe-commits mailing list