aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2014-10-17 18:37:25 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2014-10-17 18:37:25 +0000
commit92574c7cdbf3f32fdc48897990d63e1dc65d5bbf (patch)
tree576be955533c5d97f1f9b493e159d598e84dc02a /gcc/c
parentf5db965fda4963a26a8e8d6943fb2cab8c590847 (diff)
downloadgcc-92574c7cdbf3f32fdc48897990d63e1dc65d5bbf.zip
gcc-92574c7cdbf3f32fdc48897990d63e1dc65d5bbf.tar.gz
gcc-92574c7cdbf3f32fdc48897990d63e1dc65d5bbf.tar.bz2
c-opts.c (c_common_post_options): Set warn_implicit_int.
c-family/ * c-opts.c (c_common_post_options): Set warn_implicit_int. * c.opt (Wimplicit-int): Initialize to -1. c/ * c-decl.c (grokdeclarator): Use OPT_Wimplicit_int unconditionally. (start_function): Use OPT_Wimplicit_int instead of 0. (store_parm_decls_oldstyle): Likewise. testsuite/ * gcc.dg/Wimplicit-int-1.c: New test. * gcc.dg/Wimplicit-int-2.c: New test. * gcc.dg/Wimplicit-int-3.c: New test. * gcc.dg/Wimplicit-int-4.c: New test. From-SVN: r216412
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-decl.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index ac28472..d6a58a8 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-17 Marek Polacek <polacek@redhat.com>
+
+ * c-decl.c (grokdeclarator): Use OPT_Wimplicit_int unconditionally.
+ (start_function): Use OPT_Wimplicit_int instead of 0.
+ (store_parm_decls_oldstyle): Likewise.
+
2014-10-17 Alan Modra <amodra@gmail.com>
PR middle-end/61848
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 839c67b..b18da48 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -5330,11 +5330,11 @@ grokdeclarator (const struct c_declarator *declarator,
else
{
if (name)
- warn_defaults_to (loc, flag_isoc99 ? 0 : OPT_Wimplicit_int,
+ warn_defaults_to (loc, OPT_Wimplicit_int,
"type defaults to %<int%> in declaration "
"of %qE", name);
else
- warn_defaults_to (loc, flag_isoc99 ? 0 : OPT_Wimplicit_int,
+ warn_defaults_to (loc, OPT_Wimplicit_int,
"type defaults to %<int%> in type name");
}
}
@@ -8120,7 +8120,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
}
if (warn_about_return_type)
- warn_defaults_to (loc, flag_isoc99 ? 0
+ warn_defaults_to (loc, flag_isoc99 ? OPT_Wimplicit_int
: (warn_return_type ? OPT_Wreturn_type
: OPT_Wimplicit_int),
"return type defaults to %<int%>");
@@ -8429,7 +8429,8 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
if (flag_isoc99)
pedwarn (DECL_SOURCE_LOCATION (decl),
- 0, "type of %qD defaults to %<int%>", decl);
+ OPT_Wimplicit_int, "type of %qD defaults to %<int%>",
+ decl);
else
warning_at (DECL_SOURCE_LOCATION (decl),
OPT_Wmissing_parameter_type,