Setting a variable assigns a value to it (possibly implicitly)
int main(void) { int local1, local2; local1 = 0; local2 = 0; return 0; }
In the above program, both variables were set to a value, but they were not used. If you replace the second line with
int local2 = local1;
now I used the local1 variable - and the warnings should only be 1.
To get rid of the warning, remove the assignment from your code. This may in turn generate other warnings ... :)
source share