Boost logo

Boost :

From: (noreply_at_[hidden])
Date: 2003-09-15 14:15:08

Bugs item #806732, was opened at 2003-09-15 12:15
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:

Category: Python
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Conan Brink (conanbrink)
Assigned to: David Abrahams (david_abrahams)
Summary: BPL includes Python.h too late

Initial Comment:
Unfortunately, because Python 2.3 blindly,

unconditionally, #defines _POSIX_C_SOURCE as 200112L

on straight-out-of-the-box RedHat linux 8.0 systems

(which conditionally #define it as 199506L in features.h),

Python.h must be included before any system headers, as

mentioned in section 1.1 of the Python/C API Reference


    All function, type and macro definitions needed to use

the Python/C

    API are included in your code by the following line:

    #include "Python.h"

    This implies inclusion of the following standard

headers: <stdio.h>, <string.h>, <errno.h>, <limits.h>,

and <stdlib.h> (if available).

    Since Python may define some pre-processor

definitions which affect the standard headers on some

systems, you must include Python.h before any standard

headers are included.

BPL includes system headers before Python.h, resulting in

a 19-line warning about redefinition of _POSIX_C_SOURCE

if I do not include Python.h first or manually define

_POSIX_C_SOURCE to 200112L

And, as mentioned above, the Python developers (in their

own refusal to remedy this bug by conditionally defining

_POSIX_C_SOURCE when it was reported to them by

someone else), have passed the buck to BPL (or to

anyone else who includes Python.h).

The following one-line source file demonstrates the


#include <boost/python.hpp>


You can respond by visiting:

This email is sponsored by:ThinkGeek
Welcome to geek heaven.
Boost-bugs mailing list

Boost list run by bdawes at, gregod at, cpdaniel at, john at