diff options
author | Hans-Peter Nilsson <hp@bitrange.com> | 2003-07-28 20:03:25 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2003-07-28 20:03:25 +0000 |
commit | 85617eba1e78793df6ea010ea1e16be6cc378ac9 (patch) | |
tree | 0f1c19fbece8d2a5b50b52eb0fd803ccfc083558 /gcc/c-common.c | |
parent | f527d1964956de243f75a65dfd5215f01ed8e01a (diff) | |
download | gcc-85617eba1e78793df6ea010ea1e16be6cc378ac9.zip gcc-85617eba1e78793df6ea010ea1e16be6cc378ac9.tar.gz gcc-85617eba1e78793df6ea010ea1e16be6cc378ac9.tar.bz2 |
c-parse.in (lineno_stmt_decl_or_labels_ending_decl): Also warn when warn_declaration_after_statement.
* c-parse.in (lineno_stmt_decl_or_labels_ending_decl): Also warn
when warn_declaration_after_statement. Call pedwarn_c90, not
pedwarn. Correct message: it's "ISO C90", not "ISO C89".
* c-common.c (warn_declaration_after_statement): Define.
* c-common.h (warn_declaration_after_statement): Declare.
* c.opt (Wdeclaration-after-statement): New.
* c-errors.c (pedwarn_c90): New function.
* c-opts.c (c_common_handle_option) <case
OPT_Wdeclaration_after_statement>: New.
* c-tree.h (pedwarn_c90): Declare.
* doc/invoke.texi (Option Summary): Document
-Wdeclaration-after-statement.
(Warning Options): Ditto.
Co-Authored-By: Michael Culbertson <Michael.J.Culbertson@wheaton.edu>
From-SVN: r69899
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r-- | gcc/c-common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index 2e985c2..c579b16 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -391,6 +391,10 @@ int warn_bad_function_cast; int warn_traditional; +/* Nonzero means warn for a declaration found after a statement. */ + +int warn_declaration_after_statement; + /* Nonzero means warn for non-prototype function decls or non-prototyped defs without previous prototype. */ |