LONG_BIT == 64, can't compile

Johannes Zellner johannes at zellner.org
Sun Oct 15 02:34:39 EDT 2000


In article <slrn8uiiif.bo4.johannes at kristine.zellner.org>, Johannes Zellner wrote:
>Hello,
>
>the following lines of the latest python from cvs
>make it uncompilable here:
>
>Include/pyport.h:384
>
>#if LONG_BIT != 8 * SIZEOF_LONG
>/* 04-Oct-2000 LONG_BIT is apparently (mis)defined as 64 on some recent
> * 32-bit platforms using gcc.  We try to catch that here at compile-time
> * rather than waiting for integer multiplication to trigger bogus
> * overflows.
> */
>#error "LONG_BIT definition appears wrong for platform (bad gcc config?)."
>#endif
>
>
>LONG_BIT is apparently 64 here.
>
>I use:
>
>    GCC 2.95.2 20000220 (Debian GNU/Linux)
>
>hmm. I just commented out the above lines which makes python
>compile but I can't do integer multiplictaions.
>
>So: how can I compile the stuff then ?

I located the problem to be in /usr/include/bits/xopen_lim.h:

    /* Number of bits in a word of type `long int'.  */
    #if LONG_MAX == 2147483647
    # define LONG_BIT	32
    #else
    /* Safe assumption.  */
    # define LONG_BIT	64
    #endif

This fails, becauls LONG_MAX is defined to 2147483647L
                                                     ^

Where does this have to be reported ?


So again: how can I compile the stuff to get proper integer operations ?
can I simply override the definition of LONG_BIT to 32 ?

-- 
   Johannes



More information about the Python-list mailing list