Skip to content

Conversation

@encukou
Copy link
Member

@encukou encukou commented Dec 29, 2020

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]

https://bugs.python.org/issue40052

Automerge-Triggered-By: GH:pitrou

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]>
@encukou
Copy link
Member Author

encukou commented Dec 29, 2020

This supersedes (and is based on) #19133

@encukou encukou requested review from pitrou and vstinner December 29, 2020 16:45
@pitrou
Copy link
Member

pitrou commented Dec 29, 2020

@vstinner Is it ok with you?

@vstinner
Copy link
Member

LGTM. memcpy() is a safe solution to solve alignment issues ;-)

Note: PR #19133 looks wrong to me.

@miss-islington miss-islington merged commit 056c082 into python:master Dec 29, 2020
@miss-islington
Copy link
Contributor

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

miss-islington pushed 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]>
@bedevere-bot
Copy link

GH-24005 is a backport of this pull request to the 3.9 branch.

@miss-islington
Copy link
Contributor

Sorry, @encukou, I could not cleanly backport this to 3.8 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 056c08211b402b4dbc1530a9de9d00ad5309909f 3.8

@miss-islington miss-islington self-assigned this Dec 29, 2020
@encukou encukou deleted the master-alignment branch January 5, 2021 14:33
encukou added a commit that referenced this pull request Jan 5, 2021
…3999) (GH-24005)

```
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: Petr Viktorin <[email protected]>
Co-Authored-By: Andreas Schneider <[email protected]>
Co-Authored-By: Antoine Pitrou <[email protected]>
(cherry picked from commit 056c082)
encukou added a commit to encukou/cpython that referenced this pull request Jan 5, 2021
…onGH-23999)

```
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]>
@bedevere-bot
Copy link

GH-24120 is a backport of this pull request to the 3.8 branch.

encukou added a commit that referenced this pull request Jan 12, 2021
…3999) (GH-24120)

Co-Authored-By: Andreas Schneider <[email protected]>
Co-Authored-By: Antoine Pitrou <[email protected]>.
Co-authored-by: Petr Viktorin <[email protected]>

(cherry picked from commit 056c082)
https://bugs.python.org/issue40052
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants