[issue16086] tp_flags: Undefined behaviour with 32 bits long

2018-11-29 Thread STINNER Victor
STINNER Victor added the comment: New changeset 2a852a2b122cf9545909234cdc8fca564dc8f805 by Victor Stinner (Miss Islington (bot)) in branch '3.6': bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10790) https://github.com/python/cpython/commit/2a852a2b122cf9545909234cdc8fca564dc8

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2018-11-29 Thread STINNER Victor
STINNER Victor added the comment: New changeset e754159ef0af99a4124dd041ab7ceb77fcc922ad by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10789) https://github.com/python/cpython/commit/e754159ef0af99a4124dd041ab7ceb77fcc9

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2018-11-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +10037 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2018-11-29 Thread STINNER Victor
STINNER Victor added the comment: New changeset 9fbcfc08e5814d7aa9287740187e461425a99f67 by Victor Stinner (Eddie Elizondo) in branch 'master': bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) https://github.com/python/cpython/commit/9fbcfc08e5814d7aa9287740187e461425a99f67 ---

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2018-11-29 Thread miss-islington
Change by miss-islington : -- pull_requests: +10036 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2018-11-28 Thread Eddie Elizondo
Change by Eddie Elizondo : -- pull_requests: +10032 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2013-01-15 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue9307. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-30 Thread STINNER Victor
STINNER Victor added the comment: > Note that Py_TPFLAGS_INT_SUBCLASS already not used in Python 3.x. One bit of > tp_flags can be freed. Please open a new issue if you consider this issue important enough. -- ___ Python tracker

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Note that Py_TPFLAGS_INT_SUBCLASS already not used in Python 3.x. One bit of tp_flags can be freed. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-30 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 10795aac6df7 by Victor Stinner in branch 'default': Issue #16086: PyTypeObject.tp_flags and PyType_Spec.flags are now unsigned http://hg.python.org/cpython/rev/10795aac6df7 -- nosy: +python-dev ___ Python

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-12 Thread STINNER Victor
STINNER Victor added the comment: Can anyone review my new patch, unsigned_tp_flags-2.patch? -- ___ Python tracker ___ ___ Python-bugs

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-01 Thread STINNER Victor
STINNER Victor added the comment: > tp_flags type is long, not int. Oh, I misunderstood what MvL wrote, sorry. I missed PyType_Spec structure. Here is an updated and more complete patch. I changed the return code of PyType_GetFlags(), instead of changing PyType_HasFeature() macro. > OTOH, a n

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-01 Thread Martin v . Löwis
Martin v. Löwis added the comment: > tp_flags type is long, not int. Indeed, and PyType_Spec.flags is int, not long. -- ___ Python tracker ___ __

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-01 Thread STINNER Victor
STINNER Victor added the comment: tp_flags type is long, not int. Le 1 oct. 2012 16:42, "Martin v. Löwis" a écrit : > > Martin v. Löwis added the comment: > > What matters is that precompiled stay compatible; in addition, existing > source code should continue to compile unmodified. > > In the

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-10-01 Thread Martin v . Löwis
Martin v. Löwis added the comment: What matters is that precompiled stay compatible; in addition, existing source code should continue to compile unmodified. In the specific case, the flags type also shows up in PyType_Spec. As a consequence, the actual TPFLAGS_ values *do* constitute a part o

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-09-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, I'm not Martin, but I'll try to answer. An ABI pertains to the interfaces exposed by compiled object code, not source code. With C, function signatures in compiled code don't keep any type information (*), and they obviously doesn't know about macros eithe

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: Martin, some things I'm not clear on w.r.t. the stable ABI. (1) Do defined constants like Py_TPFLAGS_INT_SUBCLASS form part of the stable ABI? (2) Would changing the type of Py_TPFLAGS_INT_SUBCLASS from long to unsigned long break the stable ABI? --

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: Actually, I think it'll be messy to make this work: PyType_GetFlags is part of the stable ABI, so that's got to continue to return a long rather than an unsigned long. And then we've got, in object.h: #ifdef Py_LIMITED_API #define PyType_HasFeature(t,f) ((P

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: Victor: you missed one. :-) #define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION (3L<<15) -- ___ Python tracker ___ ___

[issue16086] tp_flags: Undefined behaviour with 32 bits long

2012-09-29 Thread STINNER Victor
New submission from STINNER Victor: "1L << 31" is undefined if long is 32 bits long. We should use unsigned long for PyTypeObject.tp_flags. Attached patch implements this fix. I don't know if it breaks somehow the backward compatibility. See also issues #1621 and #7406. -- components