-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
gh-128889: Zero out memory ctypes for generated struct layout tests #128944
Conversation
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.
LGTM: I confirm that the change does fix the #128889 issue.
Without this change, test_ctypes.test_generated_structs fails. With the change, test_ctypes.test_generated_structs pass.
Thank you for the check! |
|
I can confirm that the tests executed during the rpmbuild pass with the fix. |
GCC 15 doesn't set padding bits to zero (as it's allowed to, according to standard). Let's zero the test structs explicitly.
Even with this PR, the tests still depend on the compiler keeping padding bits unchanged when surrounding values are set. (AFAIK, this is not guaranteed by the standard, and when bitfields are involved, changing padding bits might make sense as an optimization.)
Removing that limitation will be easier with introspection attributes I want to add in gh-128715.