aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@cam.ac.uk>2001-02-12 17:31:42 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2001-02-12 17:31:42 +0000
commitf43b27955c8481056c36a99ea05f7d5523169e49 (patch)
tree1198d5daa5758bb57dfd972c4736717092539847 /gcc/c-decl.c
parentc6b33a47ea7d36d3e9eb4de227778332b179704d (diff)
downloadgcc-f43b27955c8481056c36a99ea05f7d5523169e49.zip
gcc-f43b27955c8481056c36a99ea05f7d5523169e49.tar.gz
gcc-f43b27955c8481056c36a99ea05f7d5523169e49.tar.bz2
c-decl.c (grokdeclarator): In C99 mode...
* c-decl.c (grokdeclarator): In C99 mode, give the more specific "return type defaults" warning for functions with return type defaulting to int. * c-lang.c (c_init): In C99 mode, enable warnings for implicit function declarations by default rather than only when pedantic. testsuite: * gcc.dg/c99-impl-int-1.c: Use stricter error string for implicit return type. * gcc.dg/cpp/digraphs.c: Declare puts. From-SVN: r39608
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index ef5bb38..f0d229d 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -3973,7 +3973,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
/* Issue a warning if this is an ISO C 99 program or if -Wreturn-type
and this is a function, or if -Wimplicit; prefer the former
warning since it is more explicit. */
- if ((warn_implicit_int || warn_return_type) && funcdef_flag)
+ if ((warn_implicit_int || warn_return_type || flag_isoc99)
+ && funcdef_flag)
warn_about_return_type = 1;
else if (warn_implicit_int || flag_isoc99)
pedwarn_c99 ("type defaults to `int' in declaration of `%s'",