mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-01 20:26:20 +08:00
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
This commit is contained in:
parent
9e3685d5f4
commit
db838bb85b
@ -1,3 +1,11 @@
|
||||
Sat Jan 16 19:31:07 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* 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.
|
||||
|
||||
Sat Jan 16 15:13:46 1999 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* pa.md (shadd): Create shadd insns, even if the result of the shift is
|
||||
|
10
gcc/c-decl.c
10
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
|
||||
|
@ -1,4 +1,4 @@
|
||||
@c Copyright (C) 1988,89,92,93,94,95,96,97,98,1999 Free Software Foundation, Inc.
|
||||
@c Copyright (C) 1988, 89, 92-98, 1999 Free Software Foundation, Inc.
|
||||
@c This is part of the GCC manual.
|
||||
@c For copying conditions, see the file gcc.texi.
|
||||
|
||||
@ -1548,6 +1548,10 @@ the block.
|
||||
|
||||
@item
|
||||
A @code{switch} statement has an operand of type @code{long}.
|
||||
|
||||
@item
|
||||
A non-@code{static} function declaration follows a @code{static} one.
|
||||
This construct is not accepted by some traditional C compilers.
|
||||
@end itemize
|
||||
|
||||
@item -Wundef
|
||||
|
Loading…
Reference in New Issue
Block a user