[prev in list] [next in list] [prev in thread] [next in thread]
List: cfe-dev
Subject: Re: [cfe-dev] Spurious puzzling warning with --analyze
From: Ted Kremenek <kremenek () apple ! com>
Date: 2010-08-26 20:31:03
Message-ID: 6049EB8E-EE53-41AB-A6DE-7E54552E6297 () apple ! com
[Download RAW message or body]
Hi Robert,
Please file a bugzilla report. The problem is that '1 << n' is not getting \
accurately modeled, resulting in a false path that triggers the warning.
On Aug 24, 2010, at 1:49 AM, Robert Purves wrote:
> $ cat test.c
>
> void bar( int x ) { }
>
> void foo( int n )
> {
> int x[4096], i;
>
> for ( i = 0; i < (1 << n); i++ )
> {
> x[i] = i;
> }
>
> for ( i = 0; i < (1 << n); i++ )
> {
> bar( x[i] );
> }
> }
>
> $ clang test.c --analyze
> test.c:15:3: warning: Pass-by-value argument in function call is undefined
> bar( x[i] );
> ^ ~~~~
> $ clang --version
> clang version 2.8 (trunk 111903)
>
> Robert P.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
_______________________________________________
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