]> 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 07:33:37 +0000 (09:33 +0200)
commit5d8585b588fb9f81e741b765603053e4cadcf1ac
treecc63382206225a0f3d6cd71fa7b83b8453223514
parentbdf4c6b635789e37412fd0b393c637d91ce9cd7b
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.
src/ccache.c
src/compopt.c
src/compopt.h
unittest/test_argument_processing.c