[PATCH] check for Incorrect logic in operator

Jordan Rose jordan_rose at apple.com
Fri Oct 25 10:18:40 PDT 2013


Richard Trieu has worked on a number of similar warnings. Maybe he can take a look?

Jordan


On Oct 25, 2013, at 8:18, Anders Rönnholm <Anders.Ronnholm at evidente.se> wrote:

> Hi,
> Resending the patch I sent last week. Anyone want to have a look at it?
> 
> //Anders
> 
> -----Original Message-----
> From: Anders Rönnholm 
> Sent: den 18 oktober 2013 16:05
> To: cfe-commits at cs.uiuc.edu
> Subject: [PATCH] check for Incorrect logic in operator
> 
> Hi,
> 
> I have a new patch I like to get reviewed. It checks for incorrect logics in relational,equal and logic operators in cfgbuilder when trying to evaluate bool. A warning is emitted in Sema when an error occurs. 
> 
> eg.
> if (x != 2 || x != 3) { } always true
> if ((x < y) <= 10) {}  always true
> 
> Thanks,
> Anders 
> <incorrectoperatorlogic.diff>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list