Building Python 2.2.1 for HP Tru64 UNIX V4.0F

Neal Norwitz neal at metaslash.com
Wed Oct 9 15:56:54 CEST 2002


On Wed, 09 Oct 2002 09:21:47 -0400, change wrote:

> Hi,
> 
> I'm trying to build Python 2.2.1 for HP (COMPAQ) Tru64 UNIX V4.0F with
> the debug option.

2.2.2 beta is out.  Could you try that version?  I don't think
it will fix the problem, but it's a better starting point.

> The build fails in Python/marshal.c:
> The problem seems to be the definition of Py_SAFE_DOWNCAST in
> Include/pyport.h
> 
> #ifdef Py_DEBUG
> #define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) \
>         (assert((WIDE)(NARROW)(VALUE) == (VALUE)), (NARROW)(VALUE))
> #else
> #define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) (NARROW)(VALUE) 
> #endif
> 
> I also wrote a simple c program mimicking this behavior:
> 
> #include <stdio.h>
> #include <assert.h>
> 
> 
> #define SAFE_DOWNCAST(VALUE, WIDE, NARROW)  (assert
> ((WIDE)(NARROW)(VALUE) == (VALUE)), (NARROW)(VALUE))

Unless you are compiling --with-pydebug (so Py_DEBUG is defined),
you should be getting ther other macro (NARROW)(VALUE).

If you are compiling w/debug, do you have the same problem
if you don't compile with debug?

> This program does not seem to compile with the cc or the gcc compilers.
> Is there a problem with my C compilers or the switches I use with them?

The code looked fine, what version of the compilers are you using?
Have you tried using the -E option and look at the post macro processed
file?  This could determine if it's the preprocessor (cpp) or the
compiler.

Neal



More information about the Python-list mailing list