-
-
Notifications
You must be signed in to change notification settings - Fork 654
fix #18238 - ImportC: packed bitfields not implemented #21710
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
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request, @ibuclaw! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
|
8ae188f
to
5720704
Compare
long x : 8; | ||
} | ||
|
||
version (Windows) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need a better way to detect toggling -mms-bitfields
on x86 targets.
compiler/test/compilable/test18238.d
Outdated
import imports.imp18238; | ||
|
||
align(1) // align means packed | ||
struct I18238 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that's IMO suprising. The outer aggregate alignment usually doesn't affect the fields layout at all, just removes any tail padding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh well, I guess the remaining 56 bits are treated as tail padding, so probably fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, I'll have to have a look again at the state of the alignment
struct, whether or not packed
is set true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think I have it now. packed
and eg aligned(2)
were interfering with each other.
What we were left with was {packed=true, value=1}
or {packed=false, value=2}
. Instead we want {packed=true, value=2}
when both attributes are present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now its D not respecting natural alignment.
3c432b2
to
3d276de
Compare
No description provided.