diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-04-29 18:37:38 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-04-29 18:37:38 +0000 |
commit | fdc22102bf9f731a7da676913eb917114231186a (patch) | |
tree | 4898ebc187e1436f43a035187daf1589636febf4 | |
parent | 6870c63a46c7d82f40766e908e8511bc2ef0f600 (diff) |
Implement -Wvariable-decl.
ok robert@
-rw-r--r-- | gnu/gcc/gcc/c-decl.c | 2 | ||||
-rw-r--r-- | gnu/gcc/gcc/common.opt | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gnu/gcc/gcc/c-decl.c b/gnu/gcc/gcc/c-decl.c index 00b372e222d..9762d187753 100644 --- a/gnu/gcc/gcc/c-decl.c +++ b/gnu/gcc/gcc/c-decl.c @@ -4256,6 +4256,8 @@ grokdeclarator (const struct c_declarator *declarator, pedwarn ("ISO C90 forbids variable-size array %qs", name); } + if (warn_variable_decl) + warning (0, "variable-sized array %qs", name); } if (integer_zerop (size)) diff --git a/gnu/gcc/gcc/common.opt b/gnu/gcc/gcc/common.opt index d24162f13ec..99fb4438d4d 100644 --- a/gnu/gcc/gcc/common.opt +++ b/gnu/gcc/gcc/common.opt @@ -193,6 +193,10 @@ Wunused-variable Common Var(warn_unused_variable) Warn when a variable is unused +Wvariable-decl +Common Var(warn_variable_decl) +Warn about variable-sized declarations. + Wvolatile-register-var Common Var(warn_register_var) Warn when a register variable is declared volatile |