diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-04-05 17:41:31 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-04-05 17:41:31 +0000 |
commit | b5d4831f8372120a5b1aef14a8add2a0691f3977 (patch) | |
tree | 3d4cb79f6bd789a8d1658acea956929dc2f59768 /clang/test/Sema/uninit-variables.c | |
parent | 7522abd3ce7c24c27c9c9fbe2edec63962157ab2 (diff) | |
download | bcm5719-llvm-b5d4831f8372120a5b1aef14a8add2a0691f3977.tar.gz bcm5719-llvm-b5d4831f8372120a5b1aef14a8add2a0691f3977.zip |
Fix PR9624 by explicitly disabling uninitialized warnings for direct self-init:
int x = x;
GCC disables its warnings on this construct as a way of indicating that
the programmer intentionally wants the variable to be uninitialized.
Only the warning on the initializer is turned off in this iteration.
This makes the code a lot more ugly, but starts commenting the
surprising behavior here. This is a WIP, I want to refactor it
substantially for clarity, and to determine whether subsequent warnings
should be suppressed or not.
llvm-svn: 128894
Diffstat (limited to 'clang/test/Sema/uninit-variables.c')
-rw-r--r-- | clang/test/Sema/uninit-variables.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/uninit-variables.c b/clang/test/Sema/uninit-variables.c index 330444bb5c4..ee3e88a49c8 100644 --- a/clang/test/Sema/uninit-variables.c +++ b/clang/test/Sema/uninit-variables.c @@ -92,7 +92,7 @@ void test14() { } void test15() { - int x = x; // expected-warning{{variable 'x' is uninitialized when used within its own initialization}} + int x = x; // no-warning: signals intended lack of initialization. } // Don't warn in the following example; shows dataflow confluence. |