Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jan 2012 23:47:41 -0500
From:      Eitan Adler <lists@eitanadler.com>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        freebsd-standards@freebsd.org, David Schultz <das@freebsd.org>, David Chisnall <theraven@freebsd.org>, python@freebsd.org, gogo@cs.uni-sb.de
Subject:   Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE
Message-ID:  <CAF6rxgn81hxBwwx9Y6%2Bg1PFcaQjoLfQMfb5QGgycryR4PLoboA@mail.gmail.com>
In-Reply-To: <4F206B5D.3080302@FreeBSD.org>
References:  <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> <4F206B5D.3080302@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jan 25, 2012 at 3:51 PM, Andriy Gapon <avg@freebsd.org> wrote:
> on 25/01/2012 15:23 David Chisnall said the following:
>> On 22 Jan 2012, at 19:25, David Schultz wrote:
>>> Technically it's a problem with python. =C2=A0If you ask for a strict
>>> POSIX environment (doesn't matter what version) and also #include
>>> a non-POSIX header, there's no guarantee about what you'll get.
>>> I've CC'd the xlocale author in case he wants to comment or
>>> voluntarily make xlocale work in an otherwise strict POSIX
>>> environment, but that's not officially supported.
>>
>> The problem is really with glibc, which uses these macros in the opposit=
e way to everyone else (glibc thinks defining these macros means expose fun=
ctionality from this standard, don't expose it otherwise, everyone else thi=
nks they mean expose only the things defined by this standard). =C2=A0This =
makes writing portable code a pain and, while I'd usually be keen to blame =
Python for everything, in this case I sympathise with their problem.
>
> Thank you for the insights.
>
>> Would defining locale_t and the related functions in xlocale.h if we are=
 in a mode where they are not normally exposed fix the problem?
>
> I think that this should work.

What about patching python to only define the POSIX macros iff glibc
is being used (and getting this upstreamed) ?

--=20
Eitan Adler



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF6rxgn81hxBwwx9Y6%2Bg1PFcaQjoLfQMfb5QGgycryR4PLoboA>