summaryrefslogtreecommitdiff
path: root/gcc/c-family
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-family
parentf5db965fda4963a26a8e8d6943fb2cab8c590847 (diff)
downloadgcc-92574c7cdbf3f32fdc48897990d63e1dc65d5bbf.tar.gz
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-family')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-opts.c4
-rw-r--r--gcc/c-family/c.opt2
3 files changed, 10 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 0a47f434d00..6d43fb77328 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2014-10-17 Marek Polacek <polacek@redhat.com>
+
+ * c-opts.c (c_common_post_options): Set warn_implicit_int.
+ * c.opt (Wimplicit-int): Initialize to -1.
+
2014-10-16 Andrew MacLeod <amacleod@redhat.com>
* c-pragma.c: Adjust include files.
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index eb078e3f5cd..448eb3e8b74 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -864,6 +864,10 @@ c_common_post_options (const char **pfilename)
if (warn_implicit_function_declaration == -1)
warn_implicit_function_declaration = flag_isoc99;
+ /* -Wimplicit-int is enabled by default for C99. */
+ if (warn_implicit_int == -1)
+ warn_implicit_int = flag_isoc99;
+
/* Declone C++ 'structors if -Os. */
if (flag_declone_ctor_dtor == -1)
flag_declone_ctor_dtor = optimize_size;
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 72ac2eddd89..4f96cf83d84 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -488,7 +488,7 @@ C ObjC Var(warn_implicit_function_declaration) Init(-1) Warning LangEnabledBy(C
Warn about implicit function declarations
Wimplicit-int
-C ObjC Var(warn_implicit_int) Warning LangEnabledBy(C ObjC,Wimplicit)
+C ObjC Var(warn_implicit_int) Init(-1) Warning LangEnabledBy(C ObjC,Wimplicit)
Warn when a declaration does not specify a type
Wimport