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

Elevate Windows CI to /W3 (sans C4018/C4267) #17665

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

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Feb 1, 2025

C4018[1] is about unsigned/signed comparisons; C4267[2] is about conversion from size_t to a "smaller" type. We likely should resolve these warnings in the long run, but for now, it seems like a no brainer to elevate to /W3 even if we have to exempt two additional categories of warnings, since we can catch some others. And we no longer need to elevate C4010[3] to a higher level to catch it.

[1] https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4018
[2] https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4267
[3] https://learn.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4013

C4018[1] is about unsigned/signed comparisons; C4267[2] is about
conversion from `size_t` to a "smaller" type.  We likely should resolve
these warnings in the long run, but for now, it seems like a no brainer
to elevate to `/W3` even if we have to exempt two additional categories
of warnings, since we can catch some others.  And we no longer need to
elevate C4010[3] to a higher level to catch it.

[1] <https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4018>
[2] <https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4267>
[3] <https://learn.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4013>
@@ -32,7 +32,7 @@ if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts
if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS%
if "%ASAN%" equ "1" set ADD_CONF=%ADD_CONF% --enable-sanitizer --enable-debug-pack

set CFLAGS=/W2 /WX /w14013 /wd4146 /wd4244
set CFLAGS=/W3 /WX /wd4018 /wd4146 /wd4244 /wd4267
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

short comments above what these "numbers" are would greatly improve the readability

@cmb69 cmb69 marked this pull request as ready for review February 2, 2025 09:39
@cmb69 cmb69 requested a review from TimWolla as a code owner February 2, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants