1 diff -Nur gcc-4.4.7.orig/gcc/common.opt gcc-4.4.7/gcc/common.opt
2 --- gcc-4.4.7.orig/gcc/common.opt 2009-03-28 18:28:45.000000000 +0100
3 +++ gcc-4.4.7/gcc/common.opt 2014-09-09 19:50:59.000000000 +0200
6 Treat specified warning as error
10 +If environment variable GCC_NO_WERROR is set, act as -Wno-error
14 Print extra (possibly unwanted) warnings
16 Common Report Var(flag_guess_branch_prob) Optimization
17 Enable guessing of branch probabilities
20 +Common RejectNegative
22 ; Nonzero means ignore `#ident' directives. 0 means handle them.
23 ; Generate position-independent code for executables if possible
24 ; On SVR4 targets, it also controls whether or not to emit a
25 diff -Nur gcc-4.4.7.orig/gcc/c.opt gcc-4.4.7/gcc/c.opt
26 --- gcc-4.4.7.orig/gcc/c.opt 2009-09-18 23:53:23.000000000 +0200
27 +++ gcc-4.4.7/gcc/c.opt 2014-09-09 19:50:59.000000000 +0200
29 C ObjC RejectNegative Warning
30 This switch is deprecated; use -Werror=implicit-function-declaration instead
34 +; Documented in common.opt
37 C ObjC C++ ObjC++ Var(warn_float_equal) Warning
38 Warn if testing floating point numbers for equality
44 +C ObjC C++ ObjC++ RejectNegative
48 Assume normal C execution environment
49 diff -Nur gcc-4.4.7.orig/gcc/c-opts.c gcc-4.4.7/gcc/c-opts.c
50 --- gcc-4.4.7.orig/gcc/c-opts.c 2009-02-18 03:16:03.000000000 +0100
51 +++ gcc-4.4.7/gcc/c-opts.c 2014-09-09 19:50:59.000000000 +0200
53 /* Number of deferred options scanned for -include. */
54 static size_t include_cursor;
56 +/* Check if a port honours COPTS. */
57 +static int honour_copts = 0;
59 static void set_Wimplicit (int);
60 static void handle_OPT_d (const char *);
61 static void set_std_cxx98 (int);
63 enable_warning_as_error ("implicit-function-declaration", value, CL_C | CL_ObjC);
66 + case OPT_Werror_maybe_reset:
68 + char *ev = getenv ("GCC_NO_WERROR");
69 + if ((ev != NULL) && (*ev != '0'))
70 + cpp_opts->warnings_are_errors = 0;
78 flag_exceptions = value;
81 + case OPT_fhonour_copts:
82 + if (c_language == clk_c) {
87 case OPT_fimplement_inlines:
88 flag_implement_inlines = value;
90 @@ -1209,6 +1226,47 @@
94 + if (c_language == clk_c) {
95 + char *ev = getenv ("GCC_HONOUR_COPTS");
99 + else if ((*ev == '0') || (*ev == '\0'))
101 + else if (*ev == '1')
103 + else if (*ev == '2')
105 + else if (*ev == 's')
108 + warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
109 + evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */
112 + if (honour_copts == 0) {
113 + error ("someone does not honour COPTS at all in lenient mode");
115 + } else if (honour_copts != 1) {
116 + warning (0, "someone does not honour COPTS correctly, passed %d times",
119 + } else if (evv == 2) {
120 + if (honour_copts == 0) {
121 + error ("someone does not honour COPTS at all in strict mode");
123 + } else if (honour_copts != 1) {
124 + error ("someone does not honour COPTS correctly, passed %d times",
128 + } else if (evv == 0) {
129 + if (honour_copts != 1)
130 + inform (0, "someone does not honour COPTS correctly, passed %d times",
138 diff -Nur gcc-4.4.7.orig/gcc/doc/cppopts.texi gcc-4.4.7/gcc/doc/cppopts.texi
139 --- gcc-4.4.7.orig/gcc/doc/cppopts.texi 2008-06-15 11:42:13.000000000 +0200
140 +++ gcc-4.4.7/gcc/doc/cppopts.texi 2014-09-09 19:50:59.000000000 +0200
142 Make all warnings into hard errors. Source code which triggers warnings
145 + at item -Werror-maybe-reset
146 + at opindex Werror-maybe-reset
147 +Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
148 +variable is set to anything other than 0 or empty.
150 @item -Wsystem-headers
151 @opindex Wsystem-headers
152 Issue warnings for code in system headers. These are normally unhelpful
153 diff -Nur gcc-4.4.7.orig/gcc/doc/invoke.texi gcc-4.4.7/gcc/doc/invoke.texi
154 --- gcc-4.4.7.orig/gcc/doc/invoke.texi 2011-03-23 23:02:12.000000000 +0100
155 +++ gcc-4.4.7/gcc/doc/invoke.texi 2014-09-09 19:50:59.000000000 +0200
157 -Wconversion -Wcoverage-mismatch -Wno-deprecated @gol
158 -Wno-deprecated-declarations -Wdisabled-optimization @gol
159 -Wno-div-by-zero -Wempty-body -Wenum-compare -Wno-endif-labels @gol
160 --Werror -Werror=* @gol
161 +-Werror -Werror=* -Werror-maybe-reset @gol
162 -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
163 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
164 -Wformat-security -Wformat-y2k @gol
165 @@ -4182,6 +4182,22 @@
166 @option{-Wall} and by @option{-pedantic}, which can be disabled with
167 @option{-Wno-pointer-sign}.
169 + at item -Werror-maybe-reset
170 + at opindex Werror-maybe-reset
171 +Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
172 +variable is set to anything other than 0 or empty.
174 + at item -fhonour-copts
175 + at opindex fhonour-copts
176 +If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
177 +given at least once, and warn if it is given more than once.
178 +If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
180 +If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
181 +is not given exactly once.
182 +The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
183 +This flag and environment variable only affect the C language.
185 @item -Wstack-protector
186 @opindex Wstack-protector
187 @opindex Wno-stack-protector
188 @@ -5721,7 +5737,7 @@
189 second branch or a point immediately following it, depending on whether
190 the condition is known to be true or false.
192 -Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
193 +Enabled at levels @option{-O3}.
195 @item -fsplit-wide-types
196 @opindex fsplit-wide-types
197 @@ -5866,7 +5882,7 @@
198 @option{-fno-delete-null-pointer-checks} to disable this optimization
199 for programs which depend on that behavior.
201 -Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
202 +Enabled at levels @option{-O3}.
204 @item -fexpensive-optimizations
205 @opindex fexpensive-optimizations
206 diff -Nur gcc-4.4.7.orig/gcc/java/jvspec.c gcc-4.4.7/gcc/java/jvspec.c
207 --- gcc-4.4.7.orig/gcc/java/jvspec.c 2007-07-31 18:19:49.000000000 +0200
208 +++ gcc-4.4.7/gcc/java/jvspec.c 2014-09-09 19:50:59.000000000 +0200
210 class name. Append dummy `.c' that can be stripped by set_input so %b
212 set_input (concat (main_class_name, "main.c", NULL));
213 + putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */
214 err = do_spec (jvgenmain_spec);
217 diff -Nur gcc-4.4.7.orig/gcc/opts.c gcc-4.4.7/gcc/opts.c
218 --- gcc-4.4.7.orig/gcc/opts.c 2009-11-27 12:34:32.000000000 +0100
219 +++ gcc-4.4.7/gcc/opts.c 2014-09-09 19:50:59.000000000 +0200
221 flag_schedule_insns_after_reload = opt2;
224 - flag_strict_aliasing = opt2;
225 - flag_strict_overflow = opt2;
226 - flag_delete_null_pointer_checks = opt2;
227 flag_reorder_blocks = opt2;
228 flag_reorder_functions = opt2;
229 flag_tree_vrp = opt2;
232 /* -O3 optimizations. */
233 opt3 = (optimize >= 3);
234 + flag_strict_aliasing = opt3;
235 + flag_strict_overflow = opt3;
236 + flag_delete_null_pointer_checks = opt3;
237 flag_predictive_commoning = opt3;
238 flag_inline_functions = opt3;
239 flag_unswitch_loops = opt3;
240 @@ -1603,6 +1603,17 @@
241 enable_warning_as_error (arg, value, lang_mask);
244 + case OPT_Werror_maybe_reset:
246 + char *ev = getenv ("GCC_NO_WERROR");
247 + if ((ev != NULL) && (*ev != '0'))
248 + warnings_are_errors = 0;
252 + case OPT_fhonour_copts: