]> 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>
Thu, 15 Aug 2019 20:27:03 +0000 (22:27 +0200)
This is done to keep the argument order between -Werror and -Wno-error.

Fixes #451.

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

index 31425128dc66d4eec41417fa0f5893de35129d87..db01659eea8dfe8495258ce2afe18cb887cddeb2 100644 (file)
@@ -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
 
index 413a1b37a17e1defcc416ea045003ddd04b73666..6b46cbed623c8d7ea30ee3e33c34284f1d90c5ec 100644 (file)
@@ -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},
index 7974f8a7660e8394802b5dc9bb57b5c3bab37203..6993e42354cac6076cad9e82ef16a2e63a180d48 100644 (file)
@@ -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;