Issue 1290333: cjkcodec compile error under AIX 5.2 on symbol 100_encode (original) (raw)
Trying to compile Python 2.4.1 under AIX 5.2 with the native cc compiler. When compiling the module cjkcodecs the compiler will fail with these errors on the source file Modules/cjkcodecs/_codecs_cn.c
building '_codecs_cn' extension cc -DNDEBUG -O -I. -I/home/psgtools/aix52/build/Python-2.4.1/./Include -I/opt/cmax/psgtools/include -I/home/psgtools/aix52/build/Python-2.4.1/Include -I/home/psgtools/aix52/build/Python-2.4.1 -c /home/psgtools/aix52/build/Python-2.4.1/Modules/cjkcodecs/_codecs_cn.c -o build/temp.aix-5.2-2.4/_codecs_cn.o "/home/psgtools/aix52/build/Python-2.4.1/Modules/cjkcodecs/_codecs_cn.c", line 431.3: 1506-206 (S) Suffix of integer constant 100_encode is not valid. "/home/psgtools/aix52/build/Python-2.4.1/Modules/cjkcodecs/_codecs_cn.c", line 431.3: 1506-196 (W) Initialization between types "int()(union {...},const void*,const unsigned long**,unsigned long,unsigned char**,unsigned long,int)" and "int" is not allowed.
and so on.
This is happening because of the "hz" codec. Due to the way the source file uses the C preprocessor macro, and the fact that the preprocessor symbol "hz" is predefined as 100 on this platform, it is producing invalid lecical symbols such as "100_encode".
The simple solution is to insert the following line in the source file immediately before the first reference to the name "hz":
#undef hz