Compiling Python 2.1.1 without 16-bit integer type

Tim Peters tim.one at home.com
Fri Aug 10 16:47:39 EDT 2001


[Konrad Hinsen]
> I am trying to install Python 2.1.1 on a Cray T3E, whose C compiler
> doesn't have a 16-bit integer type (char is 1 byte, short is 4,
> everything else is 8). Compilation then stops with the message:
>
> Fatal Python error: Unicode configuration error: sizeof(Py_UNICODE) !=
> 2 bytes
>
> I don't need Unicode support on the Cray, but can I disable it?

No.  See the SourceForge bug list for lots more on this (search for T3E).
You're likely to have other problems on T3E too; AFAIK, if you get it to
work correctly on T3E, you'll be the first.  Also IIRC, right shifts of
signed integral types do not extend the sign bit on T3E, and there are
probably still bad assumptions to the contrary in the Python code base.
Patches appreciated!  If you find a bad right shift, replace it with the
Py_ARITHMETIC_RIGHT_SHIFT macro.

> If not, could I use a two-byte structure to represent wide characters?

No, it does arithmetic on values of this type.

> Any other suggestions?

Try current CVS.  It so happens I removed the last "exactly 2 bytes wide"
assumption from the Unicode implementation last night.  It hasn't been
*tested* on a box without a 2-byte integral type, though.





More information about the Python-list mailing list