[Python-bugs-list] WebBugRptBroken & "Python mymalloc.h; not C++ compatible" (PR#136)

aa8vb@yahoo.com aa8vb@yahoo.com
Wed, 24 Nov 1999 09:50:52 -0500 (EST)


Just tried to submit this via the web interface which has worked in the
past.  This time, I got:

    The system encountered a fatal error

    After command: 
    Received: 

    The last error code was: Connection refused 

This was a non-private bug report, as usual.

Anyway, here's the bug report:

==============================================================================

aa8vb@yahoo.com
Python mymalloc.h; not C++ compatible
Randall Hopper
1.5.2
IRIX 6.5
Private: NO

I hit a problem trying to compile wxPython on IRIX 6.5.  The issue is NULL
should be "0" when compiling for C++.  The IRIX headers define it this way.
The Python mymalloc.h header doesn't.  A work-around is to require clients
to include stdio.h before including any Python header files, but this is a
hack.

Here's a snip from a recent Python post I made with a proposed fix:

------------------------------------------------------------------------------

...After a bit of grepping, the culprit seems to be Python (1.5.2):

     /usr/local/include/python1.5/mymalloc.h:

         #ifndef NULL
         #define NULL ((ANY *)0)
         #endif

...

It appears to me that the right fix is for Python's mymalloc.h, if it must
define NULL (does it?), be updated to be more C++ friendly.  E.g.:

         #ifndef NULL
         #  ifdef __cplusplus
         #    define NULL 0
         #  else
         #    define NULL ((ANY *)0)
         #  endif
         #endif

I'm assuming there's some reason we can't just #include <stdio.h> from 
mymalloc.h (?)

------------------------------------------------------------------------------

Thanks,

Randall