1 /* RUN: %clang_cc1 -std=c89 -fsyntax-only -Wuninitialized -verify %s
2 RUN: %clang_cc1 -std=c99 -fsyntax-only -Wuninitialized -verify %s
3 RUN: %clang_cc1 -std=c11 -fsyntax-only -Wuninitialized -verify %s
4 RUN: %clang_cc1 -std=c17 -fsyntax-only -Wuninitialized -verify %s
5 RUN: %clang_cc1 -std=c2x -fsyntax-only -Wuninitialized -verify %s
6 */
7
8 /* WG14 DR338: yes
9 * C99 seems to exclude indeterminate value from being an uninitialized register
10 *
11 * Note, because we're relying on -Wuninitialized, this test has to live in its
12 * own file. That analysis will not run if the file has other errors in it.
13 */
dr338(void)14 int dr338(void) {
15 unsigned char uc; /* expected-note {{initialize the variable 'uc' to silence this warning}} */
16 return uc + 1 >= 0; /* expected-warning {{variable 'uc' is uninitialized when used here}} */
17 }
18