On Sun, 1 Apr 2018, Pali Rohár wrote:
> Command line option -Werror is dangerous as it could cause problems for
> compiling applications in future. Once gcc introduces a new warning or
> change logic for existing warnings then compilation of existing
> application via gcc could throw a new warning.
> 
> As -Werror makes all warnings fatal, it makes applications not
> compilable. -Werror makes sense only for specific gcc versions against
> which was application tested to compile correctly.

I've been hit by that, when people thought they were clever and
then caused breakage down the line with new versions of GCC.

+      if (value)
+       warning_at (loc, 0, "command line option %qs is dangerous; "
+                   "in future newly introduced non-fatal warnings "
+                   "can cause fatal errors", "-Werror");

"command-line"

> Attached patch adds a new warning when -Werror command line option is
> enabled. It warns user that usage of -Werror can be dangerous.

I'm not sure this is going to make a material difference, though I
agree that -Werror is one that should be used less (at least when
providing source code to others).

Gerald

Reply via email to