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 mark.dickinson
Recipients ezio.melotti, mark.dickinson, vstinner
Date 2012-09-29.17:14:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1348938841.63.0.341405579516.issue16086@psf.upfronthosting.co.za>
In-reply-to
Content
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)  ((PyType_GetFlags(t) & (f)) != 0)
#else
#define PyType_HasFeature(t,f)  (((t)->tp_flags & (f)) != 0)
#endif

So we'd need an extra cast from long to unsigned long in the first branch.

I suggest instead just replacing that one occurrence of (1L << 31) with (long)(1UL << 31) to get around the undefined behaviour.


P.S. The docs would also need to be updated in these two files:

   Doc/c-api/typeobj.rst
   Doc/includes/typestruct.h
History
Date User Action Args
2012-09-29 17:14:01mark.dickinsonsetrecipients: + mark.dickinson, vstinner, ezio.melotti
2012-09-29 17:14:01mark.dickinsonsetmessageid: <1348938841.63.0.341405579516.issue16086@psf.upfronthosting.co.za>
2012-09-29 17:14:01mark.dickinsonlinkissue16086 messages
2012-09-29 17:14:00mark.dickinsoncreate