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

Silence warning C4324: structure was padded due to alignment specifier #4426

Merged
merged 3 commits into from
Feb 29, 2024

Conversation

StephanTLavavej
Copy link
Member

Fixes #4425.

This globally silences the warning because I don't think it's ever useful for the STL to emit it. If the user gives us a highly-aligned type, and we have to build another type with it, warning about padding is unlikely to be productive - presumably they had reasons for making their type highly-aligned, and it's not like they can change the layout of our type. (Yeah, in theory maybe they could request a different order of tuple elements or something, but most of the time it's not going to be actionable.) And if the warning is emitted purely from STL code, as in my test case, it's extremely annoying. Finally, this is just a performance warning - it has no impact on correctness.

@StephanTLavavej StephanTLavavej added bug Something isn't working ranges C++20/23 ranges labels Feb 26, 2024
@StephanTLavavej StephanTLavavej requested a review from a team as a code owner February 26, 2024 21:28
AlexGuteniev

This comment was marked as resolved.

@StephanTLavavej

This comment was marked as resolved.

@CaseyCarter CaseyCarter removed their assignment Feb 28, 2024
@StephanTLavavej StephanTLavavej self-assigned this Feb 29, 2024
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit a6c2a72 into microsoft:main Feb 29, 2024
35 checks passed
@StephanTLavavej StephanTLavavej deleted the paddington branch February 29, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ranges C++20/23 ranges
Projects
Archived in project
3 participants