Subject: Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning

From: Junio C Hamano <[email-masked]>
Date: Mon, 24 Nov 2014 14:50:01 -0800

Ramsay Jones <[email-masked]> writes:

> ...
> Although I have not done an actual diff of the various cdef.h files, they
> do appear to be more or less the same. In other words, I no longer think
> that the change results from a 'change in priority of _XOPEN_SOURCE'. The
> issue is simply that in the old <string.h> header these functions were
> declared unconditionally; in the new headers the are contained within
> preprocessor conditionals using the __GNU_VISIBLE and __BSD_VISIBLE macros
> which are not set when _XOPEN_SOURCE is set (despite _GNU_SOURCE and
> _BSD_SOURCE being set).

So I can take your version [*1*], drop this bit from the log:

    This seems to be caused by a change to the system headers which
    results in the _XOPEN_SOURCE macro now having prioity over the
    _GNU_SOURCE and _BSD_SOURCE macros (they are simply ignored).
    This in turn leads to the declarations of the above functions
    to be suppressed.

and replace it with something like:

    <string.h> on Cygwin used to always declare the above functions,
    but a recent version of it no longer make them visible when
    _XOPEN_SOURCE is set (even if _GNU_SOURCE and _BSD_SOURCE is
    set).

and keep the rest, I think.

Thanks for digging this thoroughly.

[Reference]

*1* http://article.gmane.org/gmane.comp.version-control.git/260091