[GRASS5] GRASS 5.1 v.in.ascii bug

GFernandez-Victorio at IGAE.minhac.es GFernandez-Victorio at IGAE.minhac.es
Thu May 8 05:40:27 EDT 2003


> 
> int main( int argc, char **argv ) {
>     int i, a, x;
>     a = rand();
>     if ( a ) {
>         i = 1;
>         x = 0;
>     } else {
>         i = 0;
>     }
>     if ( i ) printf ("%d\n", x);
>     exit (0);
> }
> 
> gcc -Wall prints: warning: `x' might be used uninitialized in 
> this function
> IMHO it may not be used uninitialized. Am I missing something?  
> Please explain this to me. 
> Simply add x=0; at the beginning to avoid this warning doesn't 
> seem to be correct.


Radim. Maybe I'm missing something, but, what do you expect from 'x'
in the else case?. What is the purpouse of 'x' variable in general?

Regards


Gonzalo




More information about the grass-dev mailing list