This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pyconfig.h defines _POSIX_C_SOURCE, conflicting with feature
Type: Stage:
Components: Installation Versions: Python 2.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: doko, loewis
Priority: normal Keywords:

Created on 2003-08-23 14:19 by doko, last changed 2022-04-10 16:10 by admin. This issue is now closed.

Messages (4)
msg17898 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2003-08-23 14:19
[forwarded from http://bugs.debian.org/206805]

the installed include/python2.3/pyconfig.h defines
_POSIX_C_SOURCE, which leaks
down into packages built against python-2.3.  AFAIK,
_POSIX_C_SOURCE
is reserved for use by the C library, and is of course
defined in
/usr/include/features.h.

Example excerpt from a build log:

In file included from /usr/include/python2.3/Python.h:8,
                 from sg_config.h:22,
                 from sg.h:29,
                 from sg_project_autosave.c:26:
/usr/include/python2.3/pyconfig.h:844:1: Warnung:
"_POSIX_C_SOURCE" redefined
In file included from /usr/include/stdlib.h:25,
                 from sg_project_autosave.c:19:
/usr/include/features.h:171:1: Warnung: this is the
location of the previous definition


msg17899 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-08-31 17:26
Logged In: YES 
user_id=21627

_POSIX_C_SOURCE is not reserved for the C library, but for
the application, see

http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap02.html
(section "Strictly Conforming POSIX Application")

A conforming POSIX application *must* define
_POSIX_C_SOURCE, so if your C library also defines it, it is
a bug in the C library.

Most likely, the author failed to include Python.h before
other system headers, as required per

http://www.python.org/doc/current/api/includes.html
msg17900 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2007-01-11 09:13
8. For the C programming language, shall define _POSIX_C_SOURCE to be
    200112L before any header is included

_POSIX_C_SOURCE should be defined "before any header is included".

That phrase was taken from the following comments:

	https://sourceforge.net/tracker/?func=detail&atid=105470&aid=793764&group_id=5470

It's described at:

	Single Unix Specification 3:
	"2.2.1 Strictly Conforming POSIX Application" 8.
msg17901 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2007-01-11 21:31
Sure, and python.h does that: it defines _POSIX_C_SOURCE before any (system) header is included.

The problem is rather in SciGraphica, which include Python.h in sg_config.h *after* 
including a system header. This is in violation of the Python API, as described in
my initial message.
History
Date User Action Args
2022-04-10 16:10:48adminsetgithub: 39114
2003-08-23 14:19:03dokocreate