Re: [Mingw-users] _XOPEN_SOURCE
On 4/21/2017 11:32 AM, Keith Marshall wrote:
> On 21/04/17 15:12, Earnie wrote:
>> On 4/20/2017 11:32 AM, Bryan Henderson wrote:
>>> Keith Marshall, in a recent thread:
>>>> in _every_ case, the application is _required_ to specify the
>>>> _XOPEN_SOURCE value for which conformance is desired.
>>> Why do you say that? Common sense, or did you see it written
>>> And what do you make of the fact that every other X/Open-capable
>>> C library explicitly recognizes _XOPEN_SOURCE = null string as
>>> meaning "source code expects C library to conform to the original
>>> X/Open standard?
>> This reference  supports Bryan's assertion.
>>  http://man7.org/linux/man-pages/man7/feature_test_macros.7.html
> Yet, the example it cites requires a definition _with_ a value, (and
> moreover, a non-zero value); when preceded by:
> #define _XOPEN_SOURCE /* no value */
> GCC will complain:
> bar.c:2:19: error: operator '&&' has no left operand
> #if _XOPEN_SOURCE && _XOPEN_SOURCE < 500
So that documentation is somewhat off as defining _XOPEN_SOURCE without
a value could never be tested that way without an issue. However, here
is another reference  indicating that _XOPEN_SOURCE may be defined
without a value prior to version 500.
This reference  indicates that _XOPEN_SOURCE should contain a value.
So prior to SUSv3 it appears to be up in the air as to how the constant
should be used; with versus without a value.
Given that GCC itself doesn't manage without a value I would suggest
that the correct fix is to assign a value. The user will get further
with defining a value since there appears to be precedence for such
definition from the compiler authors.
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
MinGW-users mailing list
This list observes the Etiquette found at
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.
You may change your MinGW Account Options or unsubscribe at: