Lines Matching full:uninitialized
1 // RUN: %clang_cc1 -fsyntax-only -Wuninitialized -Wconditional-uninitialized -fsyntax-only -fblocks %s -verify
8 return x; // expected-warning{{variable 'x' is uninitialized when used here}}
24 ++x; // expected-warning{{variable 'x' is uninitialized when used here}}
30 x = y; // expected-warning{{variable 'y' is uninitialized when used here}}
36 x += 2; // expected-warning{{variable 'x' is uninitialized when used here}}
42 if (y) // expected-warning{{variable 'x' is used uninitialized whenever 'if' condition is false}} \
45 return x; // expected-note{{uninitialized use occurs here}}
52 // Warn with "may be uninitialized" here (not "is sometimes uninitialized"),
55 return x; // expected-warning{{variable 'x' may be uninitialized when used here}}
74 return x; // expected-warning{{variable 'x' may be uninitialized when used here}}
82 return x; // expected-warning{{variable 'x' may be uninitialized when used here}}
90 return x; // expected-warning{{variable 'x' may be uninitialized when used here}}
94 for (unsigned i ; n ; ++i) ; // expected-warning{{variable 'i' is uninitialized when used here}} expected-note{{initialize the variable 'i' to silence this warning}}
115 int x = x; // expected-warning {{variable 'x' is uninitialized when used within its own initialization}}
128 // Don't warn multiple times about the same uninitialized variable
131 *x = 1; // expected-warning{{variable 'x' is uninitialized when used here}}
155 if ((test19_aux1() + test19_aux2() && test19_aux1()) || test19_aux3(&z)) // expected-warning {{variable 'z' is used uninitialized whenever '||' condition is true}} expected-note {{remove the '||' if its condition is always false}}
156 return z; // expected-note {{uninitialized use occurs here}}
162 if ((x && y) || test19_aux3(&z) || test19_aux2()) // expected-warning {{variable 'z' is used uninitialized whenever '||' condition is true}} expected-note {{remove the '||' if its condition is always false}}
163 return z; // expected-note {{uninitialized use occurs here}}
181 // The basic uninitialized value analysis doesn't have enough path-sensitivity
191 return val; // expected-warning{{variable 'val' may be uninitialized when used here}}
196 return x; // expected-warning{{variable 'x' is uninitialized when used here}}
202 return x; // expected-warning{{variable 'x' is uninitialized when used here}}
213 return sizeof(int[len]); // expected-warning{{variable 'len' is uninitialized when used here}}
218 (void) ^{ (void) x; }; // expected-warning{{variable 'x' is uninitialized when captured by block}}
244 return x; // expected-warning{{variable 'x' is uninitialized when used here}}
259 goto *pc; // expected-warning{{variable 'pc' is uninitialized when used here}}
286 int z = x + y; // expected-warning {{variable 'y' is uninitialized when used here}}
293 return x ? 1 : y; // expected-warning {{variable 'y' is uninitialized when used here}}
298 if (x) y = 1; // expected-warning{{variable 'y' is used uninitialized whenever 'if' condition is false}} \
300 return y; // expected-note{{uninitialized use occurs here}}
312 test43_aux(x++); // expected-warning {{variable 'x' is uninitialized when used here}}
320 x += y; // expected-warning {{variable 'y' is uninitialized when used here}}
334 int j = i ? : 1; // expected-warning {{variable 'i' is uninitialized when used here}}
373 return x; // expected-warning {{variable 'x' may be uninitialized when used here}}
378 int y = (x); // expected-warning {{variable 'x' is uninitialized when used here}}
381 // This CFG caused the uninitialized values warning to inf-loop.
392 *len += new_len; // expected-warning {{variable 'new_len' may be uninitialized when used here}}
424 // Test uninitialized value used in loop condition.
427 for (; i < 10000; ++i) // expected-warning {{variable 'i' is uninitialized when used here}}
435 UNINIT(int, a, b); // expected-warning {{variable 'a' is uninitialized when used here}} \
438 ASSIGN(int, c, d); // expected-warning {{variable 'c' is uninitialized when used here}}
450 consume(k); // expected-warning {{variable 'k' is uninitialized}}
462 // FIXME: This should produce the 'is uninitialized' diagnostic, but we
465 consume(k); // expected-warning {{variable 'k' may be uninitialized}}
477 if (!a) { // expected-warning {{variable 'a' is uninitialized}}
492 sum += arr[i]; // expected-warning {{variable 'sum' is uninitialized}}
498 return x += 1; // expected-warning {{variable 'x' is uninitialized}}
503 x *= 0; // expected-warning {{variable 'x' is uninitialized}}
521 ++x; // expected-warning {{variable 'x' is uninitialized when used here}}