-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Remove strict-aliasing rules errors on gcc 4.8.5 #16714
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
Conversation
I don't have gcc 4.8.5 environment but your patch looks good to me. |
@methane |
@methane Can we open the backport patch for 3.8 3.7? |
@corona10 I think this is safe to backport. But I want to wait for buildbots before backporting. |
@methane Got it! |
"But I want to wait for buildbots before backporting." Thank you! |
GH-16756 is a backport of this pull request to the 3.8 branch. |
Sorry, @corona10 and @methane, I could not cleanly backport this to |
(cherry picked from commit c39d1dd) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
(cherry picked from commit c39d1dd) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Objects/dictobject.c:1136:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
PyDictKeyEntry *ep = &DK_ENTRIES(mp->ma_keys)[0]; Hum, there are other places with similar code:
Why only insert_to_emptydict() required to be modified? I'm not sure that the magic DK_ENTRIES() macro respects strict aliasing.
_dictkeysobject structure ends with:
_dictkeysobject ends with the following field, but the field is not declared in the structure:
Since it's not declared, I'm not sure that the compiler is able to align it properly. |
Remove below error on
CentOS Linux release 7.6.1810
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)