[issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h

2021-08-29 Thread RAW


RAW  added the comment:

Please look at configure.ac which is used to create configure which will 
generate pyconfig.h from pyconfig.h.in according to what features are detected 
in the system.

--
status: pending -> open

___
Python tracker 
<https://bugs.python.org/issue17120>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h

2021-08-29 Thread RAW


Change by RAW :


--
resolution: out of date -> 

___
Python tracker 
<https://bugs.python.org/issue17120>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h

2013-02-03 Thread RAW

New submission from RAW:

The header file pyconfig.h mishandles the _POSIX_C_SOURCE and _XOPEN_SOURCE 
preprocessor macros.

For older versions of Python, the pyconfig.h header specifies:

#define _POSIX_C_SOURCE 200112L

and:

#define _XOPEN_SOURCE 600

For newer versions of Python, the pyconfig.h header specifies:

#define _POSIX_C_SOURCE 200809L

and:

#define _XOPEN_SOURCE 700

The Open Group has documentation about these symbols:

http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html

In particular, the documentation states:

A POSIX-conforming application should ensure that the feature test macro 
_POSIX_C_SOURCE is defined before inclusion of any header.

So, having a header file attempting to set _POSIX_C_SOURCE violates this 
intention.

Yes, I am well aware that the Python documentation says to include Python.h 
before any standard headers are included.  However, this is still problematic.

In particular, it causes trouble for source code that wishes to include the 
Python headers and wishes to use declarations that are made visible by setting 
later values for _POSIX_C_SOURCE and _XOPEN_SOURCE.

I would suggest the pyconfig.h be updated to have something like this:

#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200112L
#ifdef _POSIX_C_SOURCE
#warning Python expects -D_POSIX_C_SOURCE=200112L or later
#undef _POSIX_C_SOURCE
#endif
#define _POSIX_C_SOURCE 200112L
#endif

and this:

#if !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600
#ifdef _XOPEN_SOURCE
#warning Python expects -D_XOPEN_SOURCE=600 or later
#undef _XOPEN_SOURCE
#endif
#define _XOPEN_SOURCE 600
#endif

--
components: Library (Lib)
messages: 181309
nosy: RAW
priority: normal
severity: normal
status: open
title: Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h
type: compile error
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5

___
Python tracker 
<http://bugs.python.org/issue17120>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h

2013-03-10 Thread RAW

RAW added the comment:

Any response?

--
status: open -> languishing

___
Python tracker 
<http://bugs.python.org/issue17120>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h

2013-03-25 Thread RAW

RAW added the comment:

Does anyone ever respond to reported issues here?

--

___
Python tracker 
<http://bugs.python.org/issue17120>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h

2013-03-25 Thread RAW

Changes by RAW :


--
status: languishing -> open

___
Python tracker 
<http://bugs.python.org/issue17120>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com