[issue17120] Mishandled _POSIX_C_SOURCE and _XOPEN_SOURCE in pyconfig.h

STINNER Victor report at bugs.python.org
Mon Aug 30 11:01:21 EDT 2021


STINNER Victor <vstinner at python.org> added the comment:

On my Fedora 34, running ./configure creates pyconfig.h with these values:

$ grep -E '_POSIX_C_SOURCE|_XOPEN_SOURCE' -B1 pyconfig.h
/* Define to activate features from IEEE Stds 1003.1-2008 */
#define _POSIX_C_SOURCE 200809L
--
/* Define to the level of X/Open that your system supports */
#define _XOPEN_SOURCE 700
--
/* Define to activate Unix95-and-earlier features */
#define _XOPEN_SOURCE_EXTENDED 1


Relevant lines in configure.ac:
---
if test $define_xopen_source = yes
then
  # X/Open 7, incorporating POSIX.1-2008
  AC_DEFINE(_XOPEN_SOURCE, 700,
            Define to the level of X/Open that your system supports)

  # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
  # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
  # several APIs are not declared. Since this is also needed in some
  # cases for HP-UX, we define it globally.
  AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
   	    Define to activate Unix95-and-earlier features)

  AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008)
fi
---

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17120>
_______________________________________


More information about the Python-bugs-list mailing list