[issue7573] Python build issue on Ubuntu 9.10

instigate_team report at bugs.python.org
Thu Dec 24 12:26:21 CET 2009


New submission from instigate_team <narine_martirosyan at instigatedesign.com>:

Hello Python development team!

We encountered problem concerning Python 3.1 usage.

Platform info:

    Ubuntu 9.10 32/64bit, glibc v. 2.10.1, gcc v. 4.4.0, Python 3.1.

Problem description:

  Below is given the C++ program text causing the warning:
   
#include <string>
#include <Python.h>

int main()
{
     return 0;
}

Compilation result is the following:

In file included from /usr/include/python3.1/Python.h:8,
                 from main.cpp:3:
/usr/include/python3.1/pyconfig.h:1108:1: warning: "_POSIX_C_SOURCE"
redefined
In file included from
/usr/include/c++/4.4/i486-linux-gnu/bits/os_defines.h:39,
                 from
/usr/include/c++/4.4/i486-linux-gnu/bits/c++config.h:243,
                 from /usr/include/c++/4.4/string:40,
                 from main.cpp:2:
/usr/include/features.h:158:1: warning: this is the location of the
previous definition
In file included from /usr/include/python3.1/Python.h:8,
                 from main.cpp:3:
/usr/include/python3.1/pyconfig.h:1130:1: warning: "_XOPEN_SOURCE" redefined
In file included from
/usr/include/c++/4.4/i486-linux-gnu/bits/os_defines.h:39,
                 from
/usr/include/c++/4.4/i486-linux-gnu/bits/c++config.h:243,
                 from /usr/include/c++/4.4/string:40,
                 from main.cpp:2:
/usr/include/features.h:160:1: warning: this is the location of the
previous definition

Analyzing the error:

We find out that the includes sequence influences on the application
build. We have no problem in case if Python header is included before
"string" file.
The problem is concerning the conflict of pyconfig.h  and features.h
(/usr/include/features.h, which is the part of glibc), which is included
in string header file. We have the same result with any header file,
which includes features.h file.

File features.h defines _POSIX_C_SOURCE in case of some conditions are true.

In its turn pyconfig.h contains the following code in line 1108

#define _POSIX_C_SOURCE 200112L

And we get redefinition warning. Our projects are working with gcc
-Werror flags, so this is the blocking problem.

The same happened with _XOPEN_SOURCE.

Any help from your side will be very much appreciated.

----------
components: Build
messages: 96852
nosy: instigate_team
severity: normal
status: open
title: Python build issue on Ubuntu 9.10
type: compile error
versions: Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7573>
_______________________________________


More information about the Python-bugs-list mailing list