bpo-40052: Fix alignment issue in PyVectorcall_Function() #23999
+7
−4
Conversation
In file included from /usr/include/python3.8/Python.h:147: In file included from /usr/include/python3.8/abstract.h:837: /usr/include/python3.8/cpython/abstract.h:91:11: error: cast from 'char *' to 'vectorcallfunc *' (aka 'struct _object *(**)(struct _object *, struct _object *const *, unsigned long, struct _object *)') increases required alignment from 1 to 8 [-Werror,-Wcast-align] ptr = (vectorcallfunc*)(((char *)callable) + offset); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Co-Authored-By: Andreas Schneider <[email protected]> Co-Authored-By: Antoine Pitrou <[email protected]>
This supersedes (and is based on) #19133 |
@vstinner Is it ok with you? |
LGTM. memcpy() is a safe solution to solve alignment issues ;-) Note: PR #19133 looks wrong to me. |
056c082
into
python:master
11 checks passed
11 checks passed
bedevere/news
News entry found in Misc/NEWS.d
Thanks @encukou for the PR |
miss-islington
added a commit
to miss-islington/cpython
that referenced
this pull request
Dec 29, 2020
…3999) ``` In file included from /usr/include/python3.8/Python.h:147: In file included from /usr/include/python3.8/abstract.h:837: /usr/include/python3.8/cpython/abstract.h:91:11: error: cast from 'char *' to 'vectorcallfunc *' (aka 'struct _object *(**)(struct _object *, struct _object *const *, unsigned long, struct _object *)') increases required alignment from 1 to 8 [-Werror,-Wcast-align] ptr = (vectorcallfunc*)(((char *)callable) + offset); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. ``` Co-Authored-By: Andreas Schneider <[email protected]> Co-Authored-By: Antoine Pitrou <[email protected]> (cherry picked from commit 056c082) Co-authored-by: Petr Viktorin <[email protected]>
GH-24005 is a backport of this pull request to the 3.9 branch. |
Sorry, @encukou, I could not cleanly backport this to |
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.
Co-Authored-By: Andreas Schneider [email protected]
Co-Authored-By: Antoine Pitrou [email protected]
https://bugs.python.org/issue40052
Automerge-Triggered-By: GH:pitrou