{"thread":{"id":"38027","subject":"recent cygwin breakage","startedAt":"2014-11-22T16:29:45Z","lastAt":"2014-11-23T23:06:44Z","messageCount":3,"participants":["Ramsay Jones","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"252377","messageId":"5470B9F9.2060008@ramsay1.demon.co.uk","threadId":"38027","inReplyTo":null,"subject":"recent cygwin breakage","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-11-22T16:29:45Z","receivedAt":"2014-11-22T16:29:45Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Hi Junio,\n\nJust a quick heads-up on a recent cygwin breakage.\n\nI updated my (64-bit) cygwin installation yesterday and (along\nwith many other packages) I noticed a new version of gcc (and\npresumably libc) was installed (gcc v4.8.3-5 x86-64).\n\nUnfortunately, this caused new warning to be issued when compiling\ngit. In particular, warnings about the implicit declaration of the\nmemmem(), strlcpy() and strcasestr() functions. As an example:\n\n    CC archive.o\narchive.c: In function ‘format_subst’:\narchive.c:44:3: warning: implicit declaration of function ‘memmem’ [-Wimplicit-function-declaration]\n   b = memmem(src, len, \"$Format:\", 8);\n   ^\narchive.c:44:5: warning: assignment makes pointer from integer without a cast [enabled by default]\n   b = memmem(src, len, \"$Format:\", 8);\n     ^\n\nI haven't spent too long on this, but it appears that the _XOPEN_SOURCE\nsetting now trumps _GNU_SOURCE and _BSD_SOURCE settings. (I am guessing\nthat /usr/lib/gcc/x86_64-pc-cygwin/4.8.3/include-fixed/sys/cdefs.h was\nchanged recently to reflect the new priority).\n\nAnyway, based on that quick squint, I changed git-compat-util.h, thus:\n\n    diff --git a/git-compat-util.h b/git-compat-util.h\n    index 400e921..cef2691 100644\n    --- a/git-compat-util.h\n    +++ b/git-compat-util.h\n    @@ -75,7 +75,8 @@\n     # endif\n     #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \\\n           !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \\\n    -      !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__)\n    +      !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__) && \\\n    +      !defined(__CYGWIN__)\n     #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n     #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n     #endif\n\n... which fixed up the build for me.\n\nHowever, I haven't run any tests yet. Also, I would need to check\nthis out on 32-bit cygwin (I haven't booted that laptop into Win XP\nfor quite some time!).\n\nHmm, I don't really know if this is an unintended side-effect of a\nrecent change to cygwin (or a bug), but I couldn't see any mention\nof this on the cygwin mailing list. (I don't intend to report this\nto that mailing list; I don't want to subscribe to (yet another)\nbusy list). :(\n\nATB,\nRamsay Jones\n"},{"id":"252397","messageId":"xmqqr3wtyed6.fsf@gitster.dls.corp.google.com","threadId":"38027","inReplyTo":"5470B9F9.2060008@ramsay1.demon.co.uk","subject":"Re: recent cygwin breakage","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-23T18:13:25Z","receivedAt":"2014-11-23T18:13:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> Just a quick heads-up on a recent cygwin breakage.\n> \n> I updated my (64-bit) cygwin installation yesterday and (along\n> with many other packages) I noticed a new version of gcc (and\n> presumably libc) was installed (gcc v4.8.3-5 x86-64).\n> ...\n> However, I haven't run any tests yet. Also, I would need to check\n> this out on 32-bit cygwin (I haven't booted that laptop into Win XP\n> for quite some time!).\n>\n> Hmm, I don't really know if this is an unintended side-effect of a\n> recent change to cygwin (or a bug), but I couldn't see any mention\n> of this on the cygwin mailing list. (I don't intend to report this\n> to that mailing list; I don't want to subscribe to (yet another)\n> busy list). :(\n\nThanks.\n\nI wonder if it is safe to unconditionally drop XOPEN_SOURCE; would\nit cause problems for older Cygwin to those who have not updated to\nthe recent one yet?  The proposed change looks trivially correct\notherwise.\n"},{"id":"252411","messageId":"54726884.5070902@ramsay1.demon.co.uk","threadId":"38027","inReplyTo":"xmqqr3wtyed6.fsf@gitster.dls.corp.google.com","subject":"Re: recent cygwin breakage","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-11-23T23:06:44Z","receivedAt":"2014-11-23T23:06:44Z","isPatch":false,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 23/11/14 18:13, Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n> \n>> Just a quick heads-up on a recent cygwin breakage.\n>>\n>> I updated my (64-bit) cygwin installation yesterday and (along\n>> with many other packages) I noticed a new version of gcc (and\n>> presumably libc) was installed (gcc v4.8.3-5 x86-64).\n>> ...\n>> However, I haven't run any tests yet. Also, I would need to check\n>> this out on 32-bit cygwin (I haven't booted that laptop into Win XP\n>> for quite some time!).\n>>\n>> Hmm, I don't really know if this is an unintended side-effect of a\n>> recent change to cygwin (or a bug), but I couldn't see any mention\n>> of this on the cygwin mailing list. (I don't intend to report this\n>> to that mailing list; I don't want to subscribe to (yet another)\n>> busy list). :(\n> \n> Thanks.\n> \n> I wonder if it is safe to unconditionally drop XOPEN_SOURCE; would\n> it cause problems for older Cygwin to those who have not updated to\n> the recent one yet?  The proposed change looks trivially correct\n> otherwise.\n\nI honestly don't know. I have never attempted to rollback an update\nto cygwin. (I guess it is possible, but I really don't know how ...)\n\nHowever, ...\n\nATB,\nRamsay Jones\n"}]}