Commit 54ff999a by James A. Morrison

var_defs: Add uninitialized variables.

2005-02-26  James A. Morrison  <phython@gcc.gnu.org>

        * compile/var_defs: Add uninitialized variables.

From-SVN: r95585
parent b12d3a19
2005-02-26 James A. Morrison <phython@gcc.gnu.org> 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. * compile/extrafunc.tree, compile/extravar.tree: New tests.
2005-02-26 James A. Morrison <phython@gcc.gnu.org> 2005-02-26 James A. Morrison <phython@gcc.gnu.org>
......
// { dg-do compile } // { dg-do compile }
// { dg-options "-Wuninitialized -O" }
external_definition void boring (int arg0); external_definition void boring (int arg0);
external_definition char condition (char arg1, char arg2); external_definition char condition (char arg1, char arg2);
external_definition int first_nonzero (int arg5, int arg6); external_definition int first_nonzero (int arg5, int arg6);
...@@ -14,11 +15,12 @@ condition ...@@ -14,11 +15,12 @@ condition
if (arg1) if (arg1)
{ {
automatic int i; automatic int i;
return arg1; return i + 1; // { dg-warning "uninitialized" }
} }
else else
{ {
return 0; automatic int j;
return j; // { dg-warning "uninitialized" }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment