From 70986342c8948ac2ae974ee98efbcd6865003dc1 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Thu, 15 Aug 2019 22:20:38 +0200 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20pass=20-Wno-error=20to=20the=20p?= =?utf8?q?reprocessor?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is done to keep the argument order between -Werror and -Wno-error. Fixes #451. --- doc/NEWS.adoc | 5 ++++- src/compopt.c | 1 + unittest/test_argument_processing.c | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/NEWS.adoc b/doc/NEWS.adoc index 31425128d..db01659ee 100644 --- a/doc/NEWS.adoc +++ b/doc/NEWS.adoc @@ -13,8 +13,11 @@ Bug fixes e.g. ecryptfs or btrfs/zfs with transparent compression. This also fixes a related problem with ccache's own test suite. +- Fixed a regression in 3.7.2 when using the compiler option “-Werror” and then + “-Wno-error” later on the command line. -ccache 3.7.2 + +ccache 4.7.2 ------------ Release date: 2019-07-19 diff --git a/src/compopt.c b/src/compopt.c index 413a1b37a..6b46cbed6 100644 --- a/src/compopt.c +++ b/src/compopt.c @@ -75,6 +75,7 @@ static const struct compopt compopts[] = { {"-Wa,", TAKES_CONCAT_ARG | AFFECTS_COMP}, {"-Werror", AFFECTS_COMP}, // don't exit with error when preprocessing {"-Wl,", TAKES_CONCAT_ARG | AFFECTS_COMP}, + {"-Wno-error", AFFECTS_COMP}, {"-Xassembler", TAKES_ARG | TAKES_CONCAT_ARG | AFFECTS_COMP}, {"-Xclang", TAKES_ARG}, {"-Xlinker", TAKES_ARG | TAKES_CONCAT_ARG | AFFECTS_COMP}, diff --git a/unittest/test_argument_processing.c b/unittest/test_argument_processing.c index 7974f8a76..6993e4235 100644 --- a/unittest/test_argument_processing.c +++ b/unittest/test_argument_processing.c @@ -497,10 +497,10 @@ TEST(debug_flag_order_with_known_option_last) TEST(options_not_to_be_passed_to_the_preprocesor) { struct args *orig = args_init_from_string( - "cc -Wa,foo foo.c -g -Xlinker fie -Xlinker,fum -c -Werror"); - struct args *exp_cpp = args_init_from_string("cc -g"); + "cc -Wa,foo foo.c -g -c -DX -Werror -Xlinker fie -Xlinker,fum -Wno-error"); + struct args *exp_cpp = args_init_from_string("cc -g -DX"); struct args *exp_cc = args_init_from_string( - "cc -g -Wa,foo -Xlinker fie -Xlinker,fum -Werror -c"); + "cc -g -Wa,foo -Werror -Xlinker fie -Xlinker,fum -Wno-error -DX -c"); struct args *act_cpp = NULL; struct args *act_cc = NULL; -- 2.47.2