| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Sorry, something went wrong.
|
I've added my github username to my account on bugs.python.org and signed the CA. However I think it might take some time till the system gets the update. |
Sorry, something went wrong.
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.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
| ptr = (vectorcallfunc *)(((char *)callable) + offset); | ||
| return *ptr; | ||
| vc.data = (char *)callable + offset; | ||
| return *vc.ptr; |
There was a problem hiding this comment.
I don't think this is better. The correct, idiomatic solution is something like:
vectorcallfunc *ptr;
memcpy(ptr, (char *) callable + offset, sizeof(ptr));
return *ptr;
Sorry, something went wrong.
There was a problem hiding this comment.
(also, note that any decent compiler will optimize the memcpy call away)
Sorry, something went wrong.
| } | ||
| vectorcallfunc func = *(vectorcallfunc *)(((char *)callable) + offset); | ||
| vc.data = (char *)callable + offset; | ||
| vectorcallfunc func = *vc.ptr; |
There was a problem hiding this comment.
Same comment here.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request. And if you don't make the requested changes, you will be poked with soft cushions! |
Sorry, something went wrong.
|
In my experience, memcpy() is good solution for such problem. |
Sorry, something went wrong.
|
I've made a PR with the suggested memcpy at #23999 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.https://bugs.python.org/issue40052