Remove __packed__ attribute from header structs#46
Merged
WinterMute merged 3 commits intodevkitPro:masterfrom Jul 20, 2020
chishm:struct-packing
Merged
Remove __packed__ attribute from header structs#46WinterMute merged 3 commits intodevkitPro:masterfrom chishm:struct-packing
WinterMute merged 3 commits intodevkitPro:masterfrom
chishm:struct-packing
Conversation
The attribute causes GCC warnings when `-Waddress-of-packed-member` is enabled. It is not needed because the structs are already laid out in a packed way. To verify that the structs remain as expected, add compile-time asserts.
Contributor
Author
|
This is the PR requested by Wintermute. |
chishm
referenced
this pull request
in chishm/nitrohax
Jul 20, 2020
The struct doesn't actually need to be packed. But because it is defined as such, the compiler warns that it can't be cast to a uint32 without potential misaligned memory accesses. This is not a concern for the address of the NDS header that's actually used (0x027FFE00), so disable the warning. Signed-off-by: Michael "Chishm" Chisholm <chishm@chishm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The attribute causes GCC warnings when
-Waddress-of-packed-memberis enabled. It is not needed because the structs are already laid out in a packed way.To verify that the structs remain as expected, add compile-time asserts.