This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author asn
Recipients asn
Date 2020-03-24.06:58:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org>
In-reply-to
Content
In file included from /builds/cryptomilk/pam_wrapper/src/python/pypamtest.c:21:
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.


The correct way to do it would be:

union {
   char *data;
   vectorcallfunc *ptr;
} vc;

vc.data = (char *)callable + offset;
return *vc.ptr;
History
Date User Action Args
2020-03-24 06:58:12asnsetrecipients: + asn
2020-03-24 06:58:12asnsetmessageid: <1585033092.63.0.928625583781.issue40052@roundup.psfhosted.org>
2020-03-24 06:58:12asnlinkissue40052 messages
2020-03-24 06:58:12asncreate