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

Raise MSVC warning level from /W3 to /W4 #2100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kbenzie
Copy link
Contributor

@kbenzie kbenzie commented Sep 18, 2024

This patch increases the warning level when using the MSVC compiler from /W3 to /W4 and fixes the issues found. Four warnings introduced by /W4 are disabled, all related to variable name shadowing, as they are overly prescriptive to valid code.

intel/llvm#15745

@kbenzie kbenzie requested review from a team as code owners September 18, 2024 10:10
@github-actions github-actions bot added loader Loader related feature/bug common Changes or additions to common utilities conformance Conformance test suite issues. specification Changes or additions to the specification level-zero L0 adapter specific issues command-buffer Command Buffer feature addition/changes/specification labels Sep 18, 2024
source/common/ur_util.hpp Outdated Show resolved Hide resolved
@kbenzie kbenzie force-pushed the benie/windows-warning-level-4 branch 2 times, most recently from 4a9f277 to e8e086b Compare September 18, 2024 10:31
@RossBrunton
Copy link
Contributor

On GCC, -WExtra -WError has an issue where newer versions of the compiler might introduce new warnings (or older versions might have false positives), so you end up creating a hidden dependency on a specific version of GCC. Is this an issue with MSVC as well? And if so, is it worth having a separate CMake var to turn on -WExtra / /W4?

@kbenzie
Copy link
Contributor Author

kbenzie commented Sep 18, 2024

On GCC, -WExtra -WError has an issue where newer versions of the compiler might introduce new warnings (or older versions might have false positives), so you end up creating a hidden dependency on a specific version of GCC. Is this an issue with MSVC as well? And if so, is it worth having a separate CMake var to turn on -WExtra / /W4?

I don't think extra warnings being introduced by new compilers is actually an issue, by default warnings are not treated as errors, that's only enabled with the UR_DEVELOPER_MODE=ON option. We enable that in UR CI but not downstream.

@kbenzie kbenzie force-pushed the benie/windows-warning-level-4 branch 6 times, most recently from 6a0b9b3 to 568779e Compare September 24, 2024 13:24
@kbenzie kbenzie force-pushed the benie/windows-warning-level-4 branch 4 times, most recently from c85cdf5 to 1c9da05 Compare October 3, 2024 14:01
@kbenzie kbenzie force-pushed the benie/windows-warning-level-4 branch from 1c9da05 to 2dd0821 Compare October 4, 2024 10:23
@kbenzie kbenzie force-pushed the benie/windows-warning-level-4 branch from 2dd0821 to 3186a14 Compare October 4, 2024 10:46
@kbenzie
Copy link
Contributor Author

kbenzie commented Oct 8, 2024

@oneapi-src/unified-runtime-level-zero-write do these changes look okay?

@github-actions github-actions bot added images UR images cuda CUDA adapter specific issues labels Oct 8, 2024
@kbenzie kbenzie force-pushed the benie/windows-warning-level-4 branch from 52f8ebf to 8e2f794 Compare October 8, 2024 16:09
@kbenzie kbenzie force-pushed the benie/windows-warning-level-4 branch 2 times, most recently from e7ee380 to 5627f44 Compare October 15, 2024 10:34
@kbenzie
Copy link
Contributor Author

kbenzie commented Oct 16, 2024

@oneapi-src/unified-runtime-cuda-write @oneapi-src/unified-runtime-level-zero-write please review

@kbenzie kbenzie added the ready to merge Added to PR's which are ready to merge label Oct 21, 2024
@kbenzie kbenzie force-pushed the benie/windows-warning-level-4 branch from 5627f44 to ccbfaa2 Compare October 21, 2024 15:08
@kbenzie kbenzie removed the ready to merge Added to PR's which are ready to merge label Oct 22, 2024
@kbenzie kbenzie force-pushed the benie/windows-warning-level-4 branch from ccbfaa2 to da462e9 Compare October 22, 2024 16:21
This patch increases the warning level when using the MSVC compiler from
`/W3` to `/W4` and fixes the issues found. Four warnings introduced by
`/W4` are disabled, all related to variable name shadowing, as they
overly prescriptive to valid code.
@kbenzie kbenzie force-pushed the benie/windows-warning-level-4 branch from da462e9 to 05f2a1f Compare October 23, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command-buffer Command Buffer feature addition/changes/specification common Changes or additions to common utilities conformance Conformance test suite issues. cuda CUDA adapter specific issues images UR images level-zero L0 adapter specific issues loader Loader related feature/bug specification Changes or additions to the specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants