Lines Matching +full:unused +full:- +full:variable
1 …ng_cc1 -Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores -fblocks -verify -Wno…
2 …-Wunused-variable -analyze -analyzer-checker=core,deadcode.DeadStores -analyzer-store=region -anal…
5 int k, y; // expected-warning{{unused variable 'k'}} expected-warning{{unused variable 'y'}} in f1()
7 long idx=abc+3*5; // expected-warning {{never read}} expected-warning{{unused variable 'idx'}} in f1()
11 char *c = (char*)b; // no-warning in f2()
12 char *d = b+1; // expected-warning {{never read}} expected-warning{{unused variable 'd'}} in f2()
13 …printf("%s", c); // expected-warning{{implicitly declaring library function 'printf' with type 'in… in f2()
14 // expected-note{{include the header <stdio.h> or explicitly provide a declaration for 'printf'}} in f2()
21 if ((r = f()) != 0) { // no-warning in f3()
22 int y = r; // no-warning in f3()
34 k = 2; // expected-warning {{never read}} in f4()
39 int x = 4; // no-warning in f5()
40 int *p = &x; // expected-warning{{never read}} expected-warning{{unused variable 'p'}} in f5()
48 ++x; // no-warning in f6()
54 p = 0; // no-warning in f7()
60 p = (0); // no-warning in f7b()
66 p = (void*) 0; // no-warning in f7c()
72 p = (void*) (0); // no-warning in f7d()
80 if ((p = baz())) // no-warning in f8()
87 x = x + 10; // expected-warning{{never read}} in f9()
93 x = 10 + x; // expected-warning{{never read}} in f10()
99 return x++; // expected-warning{{never read}} in f11()
104 return ((((++x)))); // no-warning in f11b()
108 int x = y; // expected-warning{{unused variable 'x'}} in f12a()
112 int x __attribute__((unused)) = y; // no-warning in f12b()
118 int x = y; // no-warning in f12c()
139 nextLineIndex = index+1; // no-warning in f14()
147 int count = x * y; // no-warning in f15()
148 int z[count]; // expected-warning{{unused variable 'z'}} in f15()
160 // Self-assignments should not be flagged as dead stores.
171 int x = 0; // no-warning in f18()
173 x = 10; // expected-warning{{Value stored to 'x' is never read}} in f18()
175 x = 10; // expected-warning{{Value stored to 'x' is never read}} in f18()
178 x = 10; // no-warning in f18()
180 return (x = 10); // no-warning in f18()
184 int x = 0; // no-warning in f18_a()
185 return (x = 10); // no-warning in f18_a()
189 int x = 0; // no-warning in f18_b()
191 x = 10; // expected-warning{{Value stored to 'x' is never read}} in f18_b()
197 x = 10; // expected-warning{{Value stored to 'x' is never read}} in f18_c()
201 int x = 0; // no-warning in f18_d()
203 x = 10; // expected-warning{{Value stored to 'x' is never read}} in f18_d()
211 int x = MyConstant; // no-warning in f19()
218 int x = MyConstant; // no-warning in f19b()
224 int x = 1; // no-warning in f20()
225 #pragma unused(x) in f20()
232 x = x + 1; // expected-warning{{never read}} in f21()
264 x = x + 1; // expected-warning{{never read}} in f22()
329 (void)(0 || (y8, ({ return; }), 1)); // expected-warning {{expression result unused}} in f22()
333 (void)(1 && (y9, ({ return; }), 1)); // expected-warning {{expression result unused}} in f22()
395 int shouldLog = (argc > 1); // no-warning in f23()
403 …gc > 1); // expected-warning{{Value stored to 'shouldLog' during its initialization is never read}… in f23_pos()
411 int x = (y > 2); // no-warning in f24_A()
413 …t z = x + y; // expected-warning{{Value stored to 'z' during its initialization is never read}} ex… in f24_A()
419 __block int x = (y > 2); // no-warning in f24_B()
422 x = 5; // no-warning in f24_B()
428 __block int x = (y > 2); // no-warning in f24_C()
430 x = 5; // no-warning in f24_C()
436 __block int x = (y > 2); // no-warning in f24_D()
439 x = 5; // no-warning in f24_D()
444 // This example shows that writing to a variable captured by a block means that it might
450 x = 4; // no-warning in f25()
461 x = 4; // no-warning in f25_b()
471 k = 1; // expected-warning{{Value stored to 'k' is never read}} in f26_nestedblocks()
483 …for ( ; ; ({ ++i; break; })) ; // expected-warning {{'break' is bound to current loop, GCC binds i… in rdar8014335()
487 i = i * 3; // expected-warning{{Value stored to 'i' is never read}} in rdar8014335()
493 // This previously caused bogus dead-stores warnings because the body of the first do...while was
501 s_rdar8320674 * tw1 = st->x; in rdar8320674()
506 …do{ (t).r = (*z2).r*(*tw1).r - (*z2).i*(*tw1).i; (t).i = (*z2).r*(*tw1).i + (*z2).i*(*tw1).r; }whi… in rdar8320674()
508 do { (*z2).r=(*z).r-(t).r; (*z2).i=(*z).i-(t).i; }while(0); in rdar8320674()
512 }while (--m); in rdar8320674()
522 i = 5; // no-warning in rdar8405222()
532 x = y = 0; // expected-warning {{never read}} in radar11185138_foo()
538 int x = y = 0; // no-warning in rdar11185138_bar()
546 x = y = 0; // no-warning in radar11185138_baz()
553 int x0 = (getInt(), 0); // expected-warning{{unused variable 'x0'}} in testBOComma()
554 …etInt()); // expected-warning {{Value stored to 'x1' during its initialization is never read}} // … in testBOComma()
555 … getInt()); //expected-warning{{Value stored to 'x2' during its initialization is never read}} // … in testBOComma()
557 x3 = (getInt(), getInt(), 0); // expected-warning{{Value stored to 'x3' is never read}} in testBOComma()
558 int x4 = (getInt(), (getInt(), 0)); // expected-warning{{unused variable 'x4'}} in testBOComma()
560 int x5 = (getInt(), (y = 0)); // expected-warning{{unused variable 'x5'}} in testBOComma()
561 …etInt())); //expected-warning {{Value stored to 'x6' during its initialization is never read}} // … in testBOComma()
562 …-warning {{Value stored to 'x8' during its initialization is never read}} // expected-warning{{unu… in testBOComma()
563 …-warning {{Value stored to 'x9' during its initialization is never read}} // expected-warning{{unu… in testBOComma()
564 …-warning {{Value stored to 'm' during its initialization is never read}} // expected-warning{{unus… in testBOComma()
565 …-warning {{Value stored to 'nn' during its initialization is never read}} // expected-warning{{unu… in testBOComma()