[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] =?utf-8?q?Static_Analysis_Warning=3F?=
From:       Jordy Rose <jediknil () belkadan ! com>
Date:       2010-08-27 22:46:22
Message-ID: 4db12a6921211957e80f6f87fa88e36f () localhost
[Download RAW message or body]


On Fri, 27 Aug 2010 17:39:12 -0500, Michael Price - Dev
<michael.b.price.dev@gmail.com> wrote:
> Consider:
> 
> #define FLOOR 1
> #define CEILING 1
> 
> int main (int argc, const char * argc[])
> {
>      printf("Hello, World! %d\n", useFloor() ? FLOOR : CEILING);
> 
>      return 0;
> }
> 
> where useFloor() returns a bool.
> 
> I would NOT want that flagged with a warning.

Good point, Michael. I think this would be more useful as a Sema warning
about identical expressions for both results of a ?:, not a value-sensitive
analyzer report. (Taking macros into account, of course; only warn if
neither expression involves a macro or both use identical macros.)
_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic