PR 32102
* doc/invoke.texi (-Wall): -Wall enables -Wstrict-overflow=1.
* flags.h (warn_strict_aliasing): Remove.
(warn_strict_overflow): Remove.
* opts.c (warn_strict_aliasing): Remove.
(warn_strict_overflow): Remove.
* c-opts.c (c_common_handle_option): -Wall only sets
-Wstrict-aliasing or -Wstrict-overflow if they are uninitialized.
(c_common_post_options): Give default values to -Wstrict-aliasing
and -Wstrict-overflow if they are uninitialized.
* common.opt (Wstrict-aliasing): Specify Var and Init.
(Wstrict-overflow): Likewise.
testsuite/
* gcc.dg/Wstrict-overflow-21.c: New.
* g++.dg/warn/Wstrict-aliasing-8.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131720
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-01-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 32102
+ * doc/invoke.texi (-Wall): -Wall enables -Wstrict-overflow=1.
+ * flags.h (warn_strict_aliasing): Remove.
+ (warn_strict_overflow): Remove.
+ * opts.c (warn_strict_aliasing): Remove.
+ (warn_strict_overflow): Remove.
+ * c-opts.c (c_common_handle_option): -Wall only sets
+ -Wstrict-aliasing or -Wstrict-overflow if they are uninitialized.
+ (c_common_post_options): Give default values to -Wstrict-aliasing
+ and -Wstrict-overflow if they are uninitialized.
+ * common.opt (Wstrict-aliasing): Specify Var and Init.
+ (Wstrict-overflow): Likewise.
+
2008-01-22 Kenneth Zadeck <zadeck@naturalbridge.com>
PR rtl-optimization/26854
warn_return_type = value;
warn_sequence_point = value; /* Was C only. */
warn_switch = value;
- set_Wstrict_aliasing (value);
+ if (warn_strict_aliasing == -1)
+ set_Wstrict_aliasing (value);
warn_address = value;
- warn_strict_overflow = value;
+ if (warn_strict_overflow == -1)
+ warn_strict_overflow = value;
warn_array_bounds = value;
/* Only warn about unknown pragmas that are not in system
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 -pedantic.
It is never enabled in C++, as the minimum limit is not normative
in that standard. */
Warn about code which might break strict aliasing rules
Wstrict-aliasing=
-Common Joined UInteger Warning
+Common Joined UInteger Var(warn_strict_aliasing) Init(-1) Warning
Warn about code which might break strict aliasing rules
Wstrict-overflow
Warn about optimizations that assume that signed overflow is undefined
Wstrict-overflow=
-Common Joined UInteger Warning
+Common Joined UInteger Var(warn_strict_overflow) Init(-1) Warning
Warn about optimizations that assume that signed overflow is undefined
Wswitch
-Wsequence-point @gol
-Wsign-compare @r{(only in C++)} @gol
-Wstrict-aliasing @gol
--Wstrict-overflow @gol
+-Wstrict-overflow=1 @gol
-Wswitch @gol
-Wtrigraphs @gol
-Wuninitialized @r{(only with} @option{-O1} @r{and above)} @gol
extern bool warn_larger_than;
extern HOST_WIDE_INT larger_than_size;
-/* Nonzero means warn about constructs which might not be strict
- aliasing safe. */
-
-extern int warn_strict_aliasing;
-
-/* Nonzero means warn about optimizations which rely on undefined
- signed overflow. */
-
-extern int warn_strict_overflow;
-
/* Temporarily suppress certain warnings.
This is set while reading code from a system header file. */
bool warn_larger_than;
HOST_WIDE_INT larger_than_size;
-/* Nonzero means warn about constructs which might not be
- strict-aliasing safe. */
-int warn_strict_aliasing;
-
-/* Nonzero means warn about optimizations which rely on undefined
- signed overflow. */
-int warn_strict_overflow;
-
/* Hack for cooperation between set_Wunused and set_Wextra. */
static bool maybe_warn_unused_parameter;
2008-01-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+ PR 32102
+ * gcc.dg/Wstrict-overflow-21.c: New.
+ * g++.dg/warn/Wstrict-aliasing-8.C: New.
+
+2008-01-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
PR middle-end/33092
* gcc.dg/pr33092.c: New.