]> git.ipfire.org Git - thirdparty/ccache.git/commit
Include compiler-only arguments in the hash
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 17 Sep 2019 20:37:57 +0000 (22:37 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 17 Sep 2019 20:37:57 +0000 (22:37 +0200)
commit6be00a0070d3898fe7201f6db44a9a3c42627bf8
tree67f0f60cbf2fe3a60eb8f5600ca3099caeac4d59
parent7fc7a18ba061ecbbd464b810d84fe174f80066ef
Include compiler-only arguments in the hash

After 5d8585b5 (#312), arguments that are not considered affecting the
preprocessor output won’t be passed to the preprocessor. -Werror and
-Wno-error are also not passed to the preprocessor so that options not
properly marked as “compiler only” will only trigger warnings, not
errors. This was a workaround for Clang complaining about unused
arguments in the preprocessor step performed by ccache.

However, it also introduced a regression: -Werror and the other options
were excluded from the hash as well. This means that

  cc -c file_with_warnings.c

would be cached by ccache, including the warning message. A later

  cc -Werror -c file_with_warnings.c

call would then be a cache hit, resulting in a compilation warning
instead of an error.

This commit fixes the problem by also including the compiler-only
arguments in the hash.
src/ccache.c
src/ccache.h
test/suites/base.bash
unittest/test_argument_processing.c