|
|
@@ -10,16 +10,13 @@
|
|
|
to be able to use -Werror in "make" but prevent
|
|
|
GNU autoconf generated configure scripts from
|
|
|
freaking out.
|
|
|
- * Make -fno-strict-aliasing and -fno-delete-null-pointer-checks
|
|
|
- the default for -O2/-Os, because they trigger gcc bugs
|
|
|
- and can delete code with security implications.
|
|
|
|
|
|
This patch was authored by Thorsten Glaser <tg at mirbsd.de>
|
|
|
with copyright assignment to the FSF in effect.
|
|
|
|
|
|
--- a/gcc/c-family/c-opts.c
|
|
|
+++ b/gcc/c-family/c-opts.c
|
|
|
-@@ -104,6 +104,9 @@ static size_t include_cursor;
|
|
|
+@@ -107,6 +107,9 @@ static int class_dump_flags;
|
|
|
/* Whether any standard preincluded header has been preincluded. */
|
|
|
static bool done_preinclude;
|
|
|
|
|
|
@@ -29,17 +26,7 @@
|
|
|
static void handle_OPT_d (const char *);
|
|
|
static void set_std_cxx98 (int);
|
|
|
static void set_std_cxx11 (int);
|
|
|
-@@ -383,6 +386,9 @@ c_common_handle_option (size_t scode, co
|
|
|
- cpp_opts->warn_endif_labels = value;
|
|
|
- break;
|
|
|
-
|
|
|
-+ case OPT_Werror_maybe_reset:
|
|
|
-+ break;
|
|
|
-+
|
|
|
- case OPT_Winvalid_pch:
|
|
|
- cpp_opts->warn_invalid_pch = value;
|
|
|
- break;
|
|
|
-@@ -491,6 +497,12 @@ c_common_handle_option (size_t scode, co
|
|
|
+@@ -442,6 +445,12 @@ c_common_handle_option (size_t scode, co
|
|
|
flag_no_builtin = !value;
|
|
|
break;
|
|
|
|
|
|
@@ -52,7 +39,7 @@
|
|
|
case OPT_fconstant_string_class_:
|
|
|
constant_string_class_name = arg;
|
|
|
break;
|
|
|
-@@ -1027,6 +1039,47 @@ c_common_init (void)
|
|
|
+@@ -1041,6 +1050,47 @@ c_common_init (void)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -102,9 +89,9 @@
|
|
|
|
|
|
--- a/gcc/c-family/c.opt
|
|
|
+++ b/gcc/c-family/c.opt
|
|
|
-@@ -379,6 +379,10 @@ Werror-implicit-function-declaration
|
|
|
- C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration)
|
|
|
- This switch is deprecated; use -Werror=implicit-function-declaration instead
|
|
|
+@@ -438,6 +438,10 @@ Wfloat-conversion
|
|
|
+ C ObjC C++ ObjC++ Var(warn_float_conversion) Warning LangEnabledBy(C ObjC C++ ObjC++,Wconversion)
|
|
|
+ Warn for implicit type conversions that cause loss of floating point precision.
|
|
|
|
|
|
+Werror-maybe-reset
|
|
|
+C ObjC C++ ObjC++
|
|
|
@@ -112,8 +99,8 @@
|
|
|
+
|
|
|
Wfloat-equal
|
|
|
C ObjC C++ ObjC++ Var(warn_float_equal) Warning
|
|
|
- Warn if testing floating point numbers for equality
|
|
|
-@@ -949,6 +953,9 @@ C++ ObjC++ Optimization Alias(fexception
|
|
|
+ Warn if testing floating point numbers for equality.
|
|
|
+@@ -1252,6 +1256,9 @@ C++ ObjC++ Optimization Alias(fexception
|
|
|
fhonor-std
|
|
|
C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
|
|
|
|
|
|
@@ -122,12 +109,12 @@
|
|
|
+
|
|
|
fhosted
|
|
|
C ObjC
|
|
|
- Assume normal C execution environment
|
|
|
+ Assume normal C execution environment.
|
|
|
--- a/gcc/common.opt
|
|
|
+++ b/gcc/common.opt
|
|
|
-@@ -541,6 +541,10 @@ Werror=
|
|
|
+@@ -581,6 +581,10 @@ Werror=
|
|
|
Common Joined
|
|
|
- Treat specified warning as error
|
|
|
+ Treat specified warning as error.
|
|
|
|
|
|
+Werror-maybe-reset
|
|
|
+Common
|
|
|
@@ -135,10 +122,10 @@
|
|
|
+
|
|
|
Wextra
|
|
|
Common Var(extra_warnings) Warning
|
|
|
- Print extra (possibly unwanted) warnings
|
|
|
-@@ -1242,6 +1246,9 @@ fguess-branch-probability
|
|
|
+ Print extra (possibly unwanted) warnings.
|
|
|
+@@ -1432,6 +1436,9 @@ fguess-branch-probability
|
|
|
Common Report Var(flag_guess_branch_prob) Optimization
|
|
|
- Enable guessing of branch probabilities
|
|
|
+ Enable guessing of branch probabilities.
|
|
|
|
|
|
+fhonour-copts
|
|
|
+Common RejectNegative
|
|
|
@@ -148,25 +135,7 @@
|
|
|
; On SVR4 targets, it also controls whether or not to emit a
|
|
|
--- a/gcc/opts.c
|
|
|
+++ b/gcc/opts.c
|
|
|
-@@ -468,8 +468,6 @@ static const struct default_options defa
|
|
|
- { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 },
|
|
|
- #endif
|
|
|
- { OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 },
|
|
|
-- { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 },
|
|
|
-- { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 },
|
|
|
- { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 },
|
|
|
- { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 },
|
|
|
- { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 },
|
|
|
-@@ -489,6 +487,8 @@ static const struct default_options defa
|
|
|
- { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 },
|
|
|
-
|
|
|
- /* -O3 optimizations. */
|
|
|
-+ { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 },
|
|
|
-+ { OPT_LEVELS_3_PLUS, OPT_fstrict_overflow, NULL, 1 },
|
|
|
- { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
|
|
|
- { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 },
|
|
|
- /* Inlining of functions reducing size is a good idea with -Os
|
|
|
-@@ -1435,6 +1435,17 @@ common_handle_option (struct gcc_options
|
|
|
+@@ -1783,6 +1783,17 @@ common_handle_option (struct gcc_options
|
|
|
opts, opts_set, loc, dc);
|
|
|
break;
|
|
|
|
|
|
@@ -200,16 +169,16 @@
|
|
|
Issue warnings for code in system headers. These are normally unhelpful
|
|
|
--- a/gcc/doc/invoke.texi
|
|
|
+++ b/gcc/doc/invoke.texi
|
|
|
-@@ -240,7 +240,7 @@ Objective-C and Objective-C++ Dialects}.
|
|
|
- -Wconversion -Wcoverage-mismatch -Wno-cpp -Wno-deprecated @gol
|
|
|
- -Wno-deprecated-declarations -Wdisabled-optimization @gol
|
|
|
- -Wno-div-by-zero -Wdouble-promotion -Wempty-body -Wenum-compare @gol
|
|
|
---Wno-endif-labels -Werror -Werror=* @gol
|
|
|
-+-Wno-endif-labels -Werror -Werror=* -Werror-maybe-reset @gol
|
|
|
- -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
|
|
|
+@@ -263,7 +263,7 @@ Objective-C and Objective-C++ Dialects}.
|
|
|
+ -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol
|
|
|
+ -Wno-div-by-zero -Wdouble-promotion -Wduplicated-cond @gol
|
|
|
+ -Wempty-body -Wenum-compare -Wno-endif-labels @gol
|
|
|
+--Werror -Werror=* -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
|
|
|
++-Werror -Werror=* -Werror-maybe-reset -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
|
|
|
-Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
|
|
|
- -Wformat-security -Wformat-y2k @gol
|
|
|
-@@ -4817,6 +4817,22 @@ This option is only supported for C and
|
|
|
+ -Wformat-security -Wformat-signedness -Wformat-y2k -Wframe-address @gol
|
|
|
+ -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
|
|
|
+@@ -5737,6 +5737,22 @@ This option is only supported for C and
|
|
|
@option{-Wall} and by @option{-Wpedantic}, which can be disabled with
|
|
|
@option{-Wno-pointer-sign}.
|
|
|
|
|
|
@@ -232,7 +201,7 @@
|
|
|
@item -Wstack-protector
|
|
|
@opindex Wstack-protector
|
|
|
@opindex Wno-stack-protector
|
|
|
-@@ -6928,7 +6944,7 @@ so, the first branch is redirected to ei
|
|
|
+@@ -6605,7 +6621,7 @@ so, the first branch is redirected to ei
|
|
|
second branch or a point immediately following it, depending on whether
|
|
|
the condition is known to be true or false.
|
|
|
|
|
|
@@ -243,7 +212,7 @@
|
|
|
@opindex fsplit-wide-types
|
|
|
--- a/gcc/java/jvspec.c
|
|
|
+++ b/gcc/java/jvspec.c
|
|
|
-@@ -626,6 +626,7 @@ lang_specific_pre_link (void)
|
|
|
+@@ -629,6 +629,7 @@ lang_specific_pre_link (void)
|
|
|
class name. Append dummy `.c' that can be stripped by set_input so %b
|
|
|
is correct. */
|
|
|
set_input (concat (main_class_name, "main.c", NULL));
|