Skip to content

Preprocessor warnings are hidden #72

@flxo

Description

@flxo

sccache hides preprocessor warnings. In the following snippet a two line c file is compiled with and without sccache using clang (Apple LLVM version 8.0.0 (clang-800.0.42.1)) and the current HEAD of sccache. As you can see the warning from the #warning directive is not on stdout/stderr. The second run with sccache shows that the behaviour is the same with or without a hit. I did the same test with a double #define - same result.

~/tmp  cat test.c
#warning foo
int bar() {}

~/tmp  clang -c -o test.o test.c
test.c:1:2: warning: foo [-W#warnings]
#warning foo
 ^
test.c:2:12: warning: control reaches end of non-void function [-Wreturn-type]
int bar() {}
           ^
2 warnings generated.
~/tmp  sccache clang -c -o test.o test.c
test.c:2:12: warning: control reaches end of non-void function [-Wreturn-type]
int bar() {}
           ^
1 warning generated.
~/tmp  sccache clang -c -o test.o test.c
test.c:2:12: warning: control reaches end of non-void function [-Wreturn-type]
int bar() {}
           ^
1 warning generated.

A possible solution could be to concat stderr from the preprocessor run with stdou/stderr from the compilation step. I'm not 100% sure whether this would give the exact same output as compiling the original file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions