diff options
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 9066bea..7b3be83 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1,5 +1,5 @@ /* Process declarations and variables for C compiler. - Copyright (C) 1988, 92-97, 1998 Free Software Foundation, Inc. + Copyright (C) 1988, 92-98, 1999 Free Software Foundation, Inc. This file is part of GNU CC. @@ -1858,6 +1858,14 @@ duplicate_decls (newdecl, olddecl, different_binding_level) && !TREE_PUBLIC (newdecl)) warning_with_decl (newdecl, "static declaration for `%s' follows non-static"); + /* If warn_traditional, warn when a non-static function + declaration follows a static one. */ + if (warn_traditional + && TREE_CODE (olddecl) == FUNCTION_DECL + && !TREE_PUBLIC (olddecl) + && TREE_PUBLIC (newdecl)) + warning_with_decl (newdecl, "non-static declaration for `%s' follows static"); + /* Warn when const declaration follows a non-const declaration, but not for functions. */ if (TREE_CODE (olddecl) != FUNCTION_DECL |