-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Bogus alignment mismatch diagnostic #125916
Comments
As @Endilll pointed out to me, |
I think you are right, giving that GCC doesn't agree that alignment of |
From GCC's documentation:
But I think that may only apply in C: https://godbolt.org/z/PnGbh6Eaa |
The original problem (which was the reason this issue was posted) is related to efivar's efi_guid_t type, which is a This is the struct: typedef struct {
uint32_t a;
uint16_t b;
uint16_t c;
uint16_t d;
uint8_t e[6];
} efi_guid_t __attribute__((__aligned__(1)));
If I understand your explanation correctly, there is no way to call I also find it weird that gcc doesn't care about alignment with all warnings enabled: https://test.godbolt.org/z/bPj514zx9 |
That matches my understanding. |
Testcase ( https://godbolt.org/z/o1b83cEbG )
The diagnostic reported is
However, the argument
alignedVariable
is 4-byte aligned, and I would expectUnalignedType
to be a one-byte aligned parameter; the reported alignments seem to be reversedThe text was updated successfully, but these errors were encountered: