A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2003-September/038100.html below:

[Python-checkins] python/dist/src/Objects unicodeobject.c, 2.197, 2.198

[Python-Dev] Re: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.197, 2.198Tim Peters tim.one at comcast.net
Tue Sep 16 17:39:58 EDT 2003
[M.-A. Lemburg]
> Note that the implementation will bomb in several places if
> Py_UNICODE is a signed type.
>
> Py_UNICODE was never intended to be a signed type, so the proper
> fix would be to add logic so that Py_UNICODE gets forced to be an
> unsigned type.

Jeremy believed Py_UNICODE was already an unsigned type on his box, and that
was the box with the segfaults.  I don't know.  Comparison with a signed int
confused the issues to the point where we gave up and just fixed it <wink>.

> The only case where Py_UNICODE could become signed is via
> a compiler that defines wchar_t to be signed -- rather unlikely.

The C standard requires wchar_t to be an integer type, but doesn't constrain
it further to an unsigned integer type.  I don't like relying on
non-standard assumptions in cases where there's little-to-no cost in not
relying on them.  For example, the cast I put in with this patch is probably
a nop on most boxes, just forcing an unsigned comparison (which must have
been the original intent, if Py_UNICODE was assumed to be an unsigned type).


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4