[Python-bugs-list] [ python-Bugs-456252 ] Python should never stomp on [u]intptr_t

noreply@sourceforge.net noreply@sourceforge.net
Tue, 28 Aug 2001 12:35:00 -0700


Bugs item #456252, was opened at 2001-08-28 12:35
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456252&group_id=5470

Category: Python Interpreter Core
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim Peters (tim_one)
Assigned to: Tim Peters (tim_one)
Summary: Python should never stomp on [u]intptr_t

Initial Comment:
Attached is from c.l.py.  Python should always use 
Py_uintptr_t (from pyport.h), and define a 
corresponding Py_intptr_t.  It should never presume to 
make up a definition for uintptr_t or intptr_t.  A 
quick glance suggests the problem is unique to 
Windows, so assigned it to me.

"""
From: python-list-admin@python.org
[mailto:python-list-admin@python.org]On Behalf Of 
Maciej Sobczak
Sent: Tuesday, August 28, 2001 3:52 AM
To: python-list@python.org
Subject: Header inconsistency?


Hi,

I'm trying to get my hands dirty with extensions and 
modules written in C/C++. I try to use SWIG.  When 
I've set up to compile the extension as a dynamic 
library, I've found that in file config.h that is 
shipped with Python distribution there are lines:

typedef long intptr_t;
typedef unsigned long uintptr_t;

whereas in some other files shipped with my compiler 
(indirectly included by my lib code) there are:

typedef int intptr_t;
typedef unsigned int uintptr_t;

The net result is that the compiler complains about 
different base types in type redefinitions. I've 
changed the config.h file to fit the rest and got my 
job done.

However, I've got a question:
Is this a problem? Or a bug? Should/Can I tinker with 
the files distributed with Python this way? Is this a 
known problem?

Few details:
I use ActiveState2.1.0 distribution and MSVC++ 
compiler on Win2000.
"""

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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456252&group_id=5470