]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Don’t pass -Wno-error to the preprocessor
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 15 Aug 2019 20:20:38 +0000 (22:20 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 16 Aug 2019 17:31:58 +0000 (19:31 +0200)
This is done to keep the argument order between -Werror and -Wno-error.

Fixes #451.

(cherry picked from commit 70986342c8948ac2ae974ee98efbcd6865003dc1)

doc/NEWS.adoc
src/compopt.cpp
unittest/test_argument_processing.cpp

index c0bb8bdd187d294ea4c4164c7130891c87fc19a2..dbe3829aec2fbad5fe1eed9b2872e3ca778d7c2f 100644 (file)
@@ -27,8 +27,11 @@ High-level summary of changes (work in progress)
 
 - (More to be written.)
 
+- 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
 
index 0bb0364513f280b1c8fc13e73a59d0f648990ccb..933671126cc88394a7c27282ca4aa3119b4f37ad 100644 (file)
@@ -79,6 +79,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},
index c42a4895b8ef2b488d9b9902821db0c5bc312ee6..0ace9fa2581e890c8ac887ef1fa2cd830998438b 100644 (file)
@@ -489,10 +489,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");
-  struct args* exp_cc =
-    args_init_from_string("cc -g -Wa,foo -Xlinker fie -Xlinker,fum -Werror -c");
+    "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 -Werror -Xlinker fie -Xlinker,fum -Wno-error -DX -c");
   struct args* act_cpp = NULL;
   struct args* act_cc = NULL;