]> git.ipfire.org Git - thirdparty/ccache.git/commit
Don’t pass -Werror and compilation-only options to the preprocessor
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 19 Jul 2019 07:22:04 +0000 (09:22 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 19 Jul 2019 09:01:01 +0000 (11:01 +0200)
commit717fcb1ec952ceda871bb008128a0a834fdc70f3
tree3fa63f8018e8dddd790407745f495b7cbe86606c
parent4e41696a56454594ce129a19a6e3cf4d15a6c467
Don’t pass -Werror and compilation-only options to the preprocessor

Clang emits warnings when it sees unused options, so when ccache runs
the Clang preprocessor separately, options that are not used by the
preprocessor will produce warnings. This means that the user may get
warnings which would not be present when not using ccache. And if
-Werror is present then the preprocessing step fails, which needless to
say is not optimal.

To work around this:

* Options known to have the above mentioned problem are not passed to
  the preprocessor.
* In addition, -Werror is also not passed to the preprocessor so that
  options not properly marked as “compiler only” will only trigger
  warnings, not errors.

Fixes #312.

(cherry picked from commit 5d8585b588fb9f81e741b765603053e4cadcf1ac)
src/ccache.c
src/compopt.c
src/compopt.h
unittest/test_argument_processing.c