[ccache] BUG: ccache + icecream + clang -Weverything results in false "warning: macro is not used [-Wunused-macros]"

Eric Chamberland Eric.Chamberland at giref.ulaval.ca
Wed Jan 22 14:20:51 UTC 2020


Hi,

We have a simple but annoying bug with ccache (3.7.1) + icecream + clang 
7.0.

This file:

=================

#define UsedMacro double

double foo();

double foo() {
   UsedMacro var = 0;
   return var;
}

=================

Compiles without warnings if compiled with bare clang 7.0 like this:

/usr/bin/clang -Weverything -c t.cc

It compiles also without warnings if I use cache:

ccache -C && /usr/lib64/ccache/clang -Weverything -c t.cc

But If I add export CCACHE_PREFIX=/opt/icecream-1.2/bin/icecc, resulting 
in this environnement:

CCACHE_PREFIX=/opt/icecream-1.2/bin/icecc
CCACHE_SLOPPINESS=include_file_mtime
CCACHE_HARDLINK=1
CCACHE_DIR=/d1/home/ericc/eric-ccache/

then I have a "false" warning:

ccache -C && /usr/lib64/ccache/clang -Weverything -c t.cc
Cleared cache
t.cc:1:9: warning: macro is not used [-Wunused-macros]
#define UsedMacro double
         ^
1 warning generated.


Is it a ccache bug or an icecream bug?

Thanks,

Eric


-- 
Eric Chamberland, ing., M. Ing
Professionnel de recherche
GIREF/Université Laval
(418) 656-2131 poste 41 22 42




More information about the ccache mailing list