mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-23 00:41:25 +08:00
var_defs: Add uninitialized variables.
2005-02-26 James A. Morrison <phython@gcc.gnu.org> * compile/var_defs: Add uninitialized variables. From-SVN: r95585
This commit is contained in:
parent
b12d3a1946
commit
54ff999a48
@ -1,3 +1,7 @@
|
||||
2005-02-26 James A. Morrison <phython@gcc.gnu.org>
|
||||
|
||||
* compile/var_defs: Add uninitialized variables.
|
||||
|
||||
2005-02-26 James A. Morrison <phython@gcc.gnu.org>
|
||||
|
||||
* compile/extrafunc.tree, compile/extravar.tree: New tests.
|
||||
|
@ -1,4 +1,5 @@
|
||||
// { dg-do compile }
|
||||
// { dg-options "-Wuninitialized -O" }
|
||||
external_definition void boring (int arg0);
|
||||
external_definition char condition (char arg1, char arg2);
|
||||
external_definition int first_nonzero (int arg5, int arg6);
|
||||
@ -14,11 +15,12 @@ condition
|
||||
if (arg1)
|
||||
{
|
||||
automatic int i;
|
||||
return arg1;
|
||||
return i + 1; // { dg-warning "uninitialized" }
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
automatic int j;
|
||||
return j; // { dg-warning "uninitialized" }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user