patch for warning on logical negation with known result

jahanian fjahanian at apple.com
Tue Nov 11 13:00:56 PST 2014


On Nov 11, 2014, at 12:16 PM, Richard Trieu <rtrieu at google.com> wrote:

> Fariborz,
> 
> I did not see any of the issues I brought up in the previous email being addressed by r221702

My apology, I forgot to mention. This patch simply provides a functionality  in c that c++ already provides. It 
issues a warning when a logical expression evaluates to ‘true’ at compile time. I changed course 
in this new patch. Can you review patch in its current form?

- Thanks, Fariborz

> 
> Richard
> 
> On Tue, Nov 11, 2014 at 11:53 AM, jahanian <fjahanian at apple.com> wrote:
> I checked a revised patch in r221702. Please review post-commit.
> 
> - Fariborz
> 
> On Oct 24, 2014, at 2:08 PM, jahanian <fjahanian at apple.com> wrote:
> 
>> Minor change. I should not bail out early when types of implicit cast and its sub expression are identical as
>> implicit cast may be for lvalue to rvalue conversion. This showed up for this test case (with old patch warning is not being issued).
>> 
>> __attribute__((__nonnull__))
>> void test1(void *nonnull) {
>>    if (nonnull) {}
>> }
>> <nonnull-patch-2.txt>
>> 
>> - Fariborz
>> 
>>> On Oct 24, 2014, at 1:23 PM, jahanian <fjahanian at apple.com> wrote:
>>> 
>>> Thanks for the review. Here is the updated patch.
>>> 
>>> 	
>>> <nonnull-patch.txt>
>>> 
>>> - Fariborz
>>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141111/cab319ed/attachment.html>


More information about the cfe-commits mailing list