[Bug driver/67640] driver passes -fdiagnostics-color= always last

2015-09-24 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67640

--- Comment #1 from Manuel López-Ibáñez  ---
Author: manu
Date: Thu Sep 24 16:37:43 2015
New Revision: 228094

URL: https://gcc.gnu.org/viewcvs?rev=228094=gcc=rev
Log:
fdiagnostics-color=never does not disable color for some diagnostics

Actually, I was trying to reject non-warning options as argument to
-Werror=. However, the new test fails because -fdiagnostics-color=never is
always placed by the driver after the warning options when calling the compiler
proper. This patch prunes all -fdiagnostics-color from the command-line but the
last one, which is moved to the first position.

gcc/ChangeLog:

2015-09-24  Manuel López-Ibáñez  

PR driver/67640
* opts-common.c (prune_options): Discard all -fdiagnostics-color
but the last one, which is moved to the front to be processed
first.
* opts.c (enable_warning_as_error): Reject options that do not
control warnings.

gcc/testsuite/ChangeLog:

2015-09-24  Manuel López-Ibáñez  

PR driver/67640
* gcc.dg/Werror-13.c: New test.


Added:
trunk/gcc/testsuite/gcc.dg/Werror-13.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/opts-common.c
trunk/gcc/opts.c
trunk/gcc/testsuite/ChangeLog

[Bug driver/67640] driver passes -fdiagnostics-color= always last

2015-09-24 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67640

Manuel López-Ibáñez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Manuel López-Ibáñez  ---
I'm going to close this as FIXED. The driver still changes the order of the
parameters passed to it, but now the compiler handles -fdiagnostics-color=
specially.