Skip to content

Fix off-by-one error in Compiler Warnings by compiler version #5215

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

Conversation

Rageking8
Copy link
Contributor

To suppress warnings in the target version and all later versions, the version specified in /Wv must be the next older one.

Copy link
Contributor

@Rageking8 : Thanks for your contribution! The author(s) have been notified to review your proposed change.

Copy link
Contributor

Learn Build status updates of commit 11a2bea:

✅ Validation status: passed

File Status Preview URL Details
docs/error-messages/compiler-warnings/compiler-warnings-by-compiler-version.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

@Court72
Copy link
Contributor

Court72 commented Mar 3, 2025

@TylerMSFT

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator bot added the aq-pr-triaged Tracking label for the PR review team label Mar 3, 2025
@TylerMSFT
Copy link
Collaborator

@Rageking8, it's Monday; help me out with your thinking here :-)
If a warning is introduced in compiler version 19.43, wouldn't you suppress that warning for 19.43 with /Wv:19.43? I'm wondering why you went a version earlier because we don't want to suppress the warnings in the previous version of the compiler, but 'this' one.

@Rageking8
Copy link
Contributor Author

In https://learn.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=msvc-170 under /Wv:

Displays only warnings introduced in the version compiler version and earlier.

So for warnings introduced in 19.43, if you put the version as 19.43, those warnings will still show, with warnings introduced in 19.44 and later silenced.

Hopefully I interpreted that right, and all subsequent ones follow that pattern of 1 version older.

@TylerMSFT
Copy link
Collaborator

I think you are right. Good catch!

Copy link
Collaborator

@TylerMSFT TylerMSFT left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this sneaky error.

@TylerMSFT
Copy link
Collaborator

#sign-off

@v-dirichards v-dirichards merged commit 0d36b2f into MicrosoftDocs:main Mar 3, 2025
2 checks passed
@Rageking8
Copy link
Contributor Author

Rageking8 commented Mar 4, 2025

I think you are right. Good catch!

Took me some time to work out which was right as well. Might be due to the "whitelist" nature of the flag /Wv instead of what I would consider more intuitive at first, "blacklist".

@Rageking8 Rageking8 deleted the fix-off-by-one-error-in-compiler-warnings-by-compiler-version branch March 5, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants