[Python-bugs-list] [ python-Bugs-607253 ] header file problems

noreply@sourceforge.net noreply@sourceforge.net
Thu, 10 Oct 2002 12:48:54 -0700


Bugs item #607253, was opened at 2002-09-10 03:53
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=607253&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
Status: Open
Resolution: Fixed
Priority: 5
Submitted By: Ralf W. Grosse-Kunstleve (rwgk)
Assigned to: Neal Norwitz (nnorwitz)
Summary: header file problems

Initial Comment:
In connection with the Boost.Python library we are 
having problems due to missing extern "C" in some 
header files. This has prompted me to systematically 
look at all header files on the release22-maint branch 
and on the CVS trunk. The summary is shown below.

The most severe problem are the missing extern "C" 
on the release-22-maint branch. Fortunately, this is 
fixed already on the CVS trunk. The next important 
problem is that the include guards are missing in 
pymactoolbox.h (both trunk and maint branch). I am 
not clear if there have to be include guards in files that 
only contain #defines (such as patchlevel.h) but 
having them would seem safer to me. Finally, the 
include guards in two files are not prefixed with Py_, 
Again, it would seem safter to me (reduce the chances 
of name clashes) if all Python include guards were 
consistently prefixed with Py_ .

Ralf


Python release22-maint cvs branch:

  extern "C" missing in:
    cStringIO.h
    descrobject.h
    iterobject.h

  include guards missing in:
    descrobject.h
    graminit.h
    iterobject.h
    patchlevel.h
    pymactoolbox.h
    (pyconfig.h)

  include guard does not start with "Py_":
    complexobject.h
    cStringIO.h

Python cvs head (Sep 9):

  include guards missing in:
    graminit.h
    patchlevel.h
    pymactoolbox.h
    (pyconfig.h)

  include guard does not start with "Py_":
    complexobject.h
    cStringIO.h


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

>Comment By: Ralf W. Grosse-Kunstleve (rwgk)
Date: 2002-10-10 12:48

Message:
Logged In: YES 
user_id=71407

Extensive tests using Python 2.2.2b1 on several platforms went 
without a problem. I suggest closing this bug report.

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

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-10-04 05:51

Message:
Logged In: YES 
user_id=33168

Backported the include guards/extern "C" for:
 * cStringIO.h 2.15.18.1
 * descrobject.h 2.8.8.1
 * iterobject.h 1.3.20.1
Fixed include guard prefix:
 * complexobject.h 2.11, 2.9.12.12.1
 * cStringIO.h 2.9, 2.15.18.2

I'm leaving open for now, so I can discuss adding include
guards for the other files (graminit.h, patchlevel.h,
pyconfig.h).

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

Comment By: Ralf W. Grosse-Kunstleve (rwgk)
Date: 2002-09-23 21:56

Message:
Logged In: YES 
user_id=71407

Patches for python-release22-maint as requested by Tim 
and Guido.


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

Comment By: Jack Jansen (jackjansen)
Date: 2002-09-10 05:34

Message:
Logged In: YES 
user_id=45365

I've added the include guard to pymactoolbox.h. I've also added include guards and extern "C" constructs (where needed) to the include files in Mac/Include. The other ones I leave to someone else, esp. because I'm not sure things like graminit.h  need them.

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

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