Skip to content

Update C2345 #4741

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

Merged
merged 2 commits into from
Oct 23, 2023
Merged

Update C2345 #4741

merged 2 commits into from
Oct 23, 2023

Conversation

Rageking8
Copy link
Contributor

__declspec(align(0)) no longer generates C2345, added a high power of 2 to trigger the error.

@prmerger-automator
Copy link
Contributor

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

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 24f8a1a:

✅ Validation status: passed

File Status Preview URL Details
docs/error-messages/compiler-errors-1/compiler-error-c2345.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

@Court72
Copy link
Contributor

Court72 commented Oct 2, 2023

@TylerMSFT

Can you review the proposed changes?

When the changes are ready for publication, add a #sign-off comment 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 Oct 2, 2023
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.

Could you remove the align(0) example altogether? It's a strange beast because it's not a valid alignment (it's ignored). I tried VS 2022, 2019, 2017, and 2015 and none of them generate the C2345 compiler error. I wonder if that was an error by the original writer. At any rate, I like the other examples but would like to remove align(0) because it muddies the waters.

The spec, N4964 9.12.2 Alignment specifier [dcl.align]/p4 says:

“The alignment requirement of an entity is the strictest nonzero alignment specified by its alignment-specifiers, if any; otherwise, the alignment-specifiers have no effect.”

So let's not use that (align(0)) example.

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 47e0013:

✅ Validation status: passed

File Status Preview URL Details
docs/error-messages/compiler-errors-1/compiler-error-c2345.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

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!

@TylerMSFT
Copy link
Collaborator

#sign-off

@American-Dipper American-Dipper merged commit f26dd39 into MicrosoftDocs:main Oct 23, 2023
@Rageking8 Rageking8 deleted the update-c2345 branch November 3, 2023 08:23
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