mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.85k stars 552 forks source link

MSVC: preprocessing is failed while compiling is success #2250

Closed AJIOB closed 2 months ago

AJIOB commented 2 months ago

Minimal reproducible example:

#pragma warning(disable : 4002)

// C4002b.cpp
// compile with: /W1 /WX
#define F(x, y)

int main()
{
    F(2, , , , , , 3, , , , , , ) // C4002
    // Try the following line instead:
    // F(2,3)

    return 0;
}

Tested with MSVC 2017, 2022.

The problem is that sccache without direct mode doesn't remove /WX flag when adding /EP one.

AJIOB commented 2 months ago

Just a note: our big project disables some different warnings in per-file or per-region manner because of the different reasons.

And this code compiles & works, similar to the #1725.

So, I suggest to just disable /WX flag (interpret warnings as errors) for removing incorrect cache tool errors