[cfe-dev] uninitialized variable generates a "Pass-by-value argument in function" warning ?!?

Ted Kremenek kremenek at apple.com
Fri May 30 08:42:06 PDT 2008


Hi Holger,

Do you have a particular question?  The warning has to do with the  
value of 'j' is uninitialized and passed as an argument to printf.  Do  
you feel that the diagnostic is unclear?  I need a little bit more  
than a screen dump to understand your concerns.

Ted

On May 30, 2008, at 3:56 AM, Holger Schurig wrote:

> $ cat main.c
> int main(int argc, char *argv[])
> {
>        int i = 0;
>        int j;
>        printf("i %d\n", i);
>        printf("j %d\n", j);
> }
>
> $ clang main.c -checker-simple
> ANALYZE: main.c main
> main.c:6:2: warning: [CHECKER] Pass-by-value argument in function
> is undefined.
>        printf("j %d\n", j);
>        ^                ~
> 1 diagnostic generated.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list