Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Force disable "warnings as errors" flag for CL preprocessing #2251

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/compiler/msvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,8 @@ pub fn preprocess_cmd<T>(
}
// Windows SDK generates C4668 during preprocessing, but compiles fine.
// Read for more info: https://github.com/mozilla/sccache/issues/1725
cmd.arg("/wd4668");
// And here: https://github.com/mozilla/sccache/issues/2250
cmd.arg("/WX-");
}

if rewrite_includes_only && is_clang {
Expand Down
8 changes: 8 additions & 0 deletions tests/msvc-preprocessing/foo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ __pragma(warning(disable: 4668))
#endif
__pragma(warning(pop))

// Minimal reproducible example for errors from user code
// More information: https://github.com/mozilla/sccache/issues/2250
#pragma warning(disable : 4002)

#define F(x, y)

int main() {
F(2, , , , , , 3, , , , , , ) // C4002

return 0;
}
Loading