aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2012-10-16 15:31:46 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2012-10-16 15:31:46 +0000
commit9286974a64c1dab24db7d326a9b077653551ed75 (patch)
tree4ce566a273abe5c8b53f22c6bfb4b3a8226b26e0 /gcc/c-family
parent51de9df6201e94cccb9350a337f658bb8bdfda5c (diff)
2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/53063 PR c/40989 gcc/ * optc-gen.awk: Handle new form of LangEnabledBy. * opts.c (set_Wstrict_aliasing): Declare here. Make static. * common.opt (Wstrict-aliasing=,Wstrict-overflow=): Do not use Init. * doc/options.texi (LangEnabledBy): Document new form. * flags.h (set_Wstrict_aliasing): Do not declare. c-family/ * c.opt (Wstrict-aliasing=,Wstrict-overflow=): Use LangEnabledBy. * c-opts.c (c_common_handle_option): Do not set them here. Add comment. (c_common_post_options): Likewise. testsuite/ * gcc.dg/Wstrict-overflow-24.c: New. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@192502 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog9
-rw-r--r--gcc/c-family/c-opts.c10
-rw-r--r--gcc/c-family/c.opt8
3 files changed, 18 insertions, 9 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 8cc5c56a919..e2499fb8dbe 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,12 @@
+2012-10-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR c/53063
+ PR c/40989
+ * c.opt (Wstrict-aliasing=,Wstrict-overflow=): Use LangEnabledBy.
+ * c-opts.c (c_common_handle_option): Do not set them here. Add
+ comment.
+ (c_common_post_options): Likewise.
+
2012-10-16 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c (ADA_HOST_WIDE_INT_PRINT_DOUBLE_HEX): Define.
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 29121b5d474..ebbf7d91c67 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -360,6 +360,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
break;
case OPT_Wall:
+ /* ??? Don't add new options here. Use LangEnabledBy in c.opt. */
handle_generated_option (&global_options, &global_options_set,
OPT_Wunused, NULL, value,
c_family_lang_mask, kind, loc,
@@ -375,11 +376,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
warn_sequence_point = value; /* Was C only. */
warn_switch = value;
warn_sizeof_pointer_memaccess = value;
- if (warn_strict_aliasing == -1)
- set_Wstrict_aliasing (&global_options, value);
warn_address = value;
- if (warn_strict_overflow == -1)
- warn_strict_overflow = value;
warn_array_bounds = value;
warn_volatile_register_var = value;
@@ -939,11 +936,6 @@ c_common_post_options (const char **pfilename)
if (warn_pointer_sign == -1)
warn_pointer_sign = 0;
- if (warn_strict_aliasing == -1)
- warn_strict_aliasing = 0;
- if (warn_strict_overflow == -1)
- warn_strict_overflow = 0;
-
/* -Woverlength-strings is off by default, but is enabled by -Wpedantic.
It is never enabled in C++, as the minimum limit is not normative
in that standard. */
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index b02c515327c..316698468c1 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -629,6 +629,14 @@ Wstrict-prototypes
C ObjC Var(warn_strict_prototypes) Warning
Warn about unprototyped function declarations
+Wstrict-aliasing=
+C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 3, 0)
+;
+
+Wstrict-overflow=
+C ObjC C++ ObjC++ LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0)
+;
+
Wstrict-selector-match
ObjC ObjC++ Var(warn_strict_selector_match) Warning
Warn if type signatures of candidate methods do not match exactly