diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1999-01-16 16:43:26 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 1999-01-16 16:43:26 +0000 |
commit | db838bb85b280d924ff9967471871739c129ff73 (patch) | |
tree | 4e24c495d7d31a07ed1376639f33476cba7c7068 /gcc/c-decl.c | |
parent | 9e3685d5f463193242bece7e381f467165adf66c (diff) | |
download | gcc-db838bb85b280d924ff9967471871739c129ff73.zip gcc-db838bb85b280d924ff9967471871739c129ff73.tar.gz gcc-db838bb85b280d924ff9967471871739c129ff73.tar.bz2 |
c-decl.c (duplicate_decls): If `warn_traditional'...
* c-decl.c (duplicate_decls): If `warn_traditional', warn when
a non-static function declaration follows a static one.
* invoke.texi (-Wtraditional): Document the extra check now done
by this flag.
From-SVN: r24703
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 |