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 schuppenies
Recipients schuppenies
Date 2008-06-17.09:38:57
SpamBayes Score 0.011926522
Marked as misclassified No
Message-id <1213695549.9.0.858416360908.issue3130@psf.upfronthosting.co.za>
In-reply-to
Content
This issue is a branch from issue3098.

Below a summary of the discussion:

Antoine Pitrou wrote:
> It seems that in some UCS4 builds, sizeof(Py_UNICODE) could end
> up being more than 4 if the native int type is itself larger than 32
> bits; although the latter is probably quite rare (64-bit platforms are
> usually either LP64 or LLP64).

Marc-Andre Lemburg wrote:
> AFAIK, only Crays have this problem, but apart from that: I'd consider
> it a bug if sizeof(Py_UCS4) != 4.

Antoine Pitrou wrote:
> Perhaps a #error can be added to that effect?
> Something like (untested):
>
> #if SIZEOF_INT == 4
> typedef unsigned int Py_UCS4;
> #elif SIZEOF_LONG == 4
> typedef unsigned long Py_UCS4;
> #else
> #error Could not find a 4-byte integer type for Py_UCS4, aborting
> #endif

Marc-Andre Lemburg wrote:
> Sounds good !
>
> Python should really try to use uint32_t as fallback solution for
> UCS4 where available (and uint16_t for UCS2).
>
> We'd have to add an AC_TYPE_INT32_T and AC_TYPE_INT16_T check to
> configure:
>
>
http://www.gnu.org/software/autoconf/manual/html_node/Particular-Types.html#Particular-Types
>
> and could then use
>
> typedef uint32_t Py_UCS4
>
> and
>
> typedef uint16_t Py_UCS2
>
> Note that the code for supporting UCS2/UCS4 is not really all that
> clean. It was a quick sprint between Martin and Fredrik and appears
> to be only half-done... e.g. there currently is no Py_UCS2.
History
Date User Action Args
2008-06-17 09:39:10schuppeniessetspambayes_score: 0.0119265 -> 0.011926522
recipients: + schuppenies
2008-06-17 09:39:09schuppeniessetspambayes_score: 0.0119265 -> 0.0119265
messageid: <1213695549.9.0.858416360908.issue3130@psf.upfronthosting.co.za>
2008-06-17 09:39:08schuppenieslinkissue3130 messages
2008-06-17 09:39:03schuppeniescreate