{"thread":{"id":"38029","subject":"[PATCH RFC] CYGWIN: avoid implicit declaration warning","startedAt":"2014-11-23T14:16:06Z","lastAt":"2014-11-24T23:04:57Z","messageCount":17,"participants":["Torsten Bögershausen","Ramsay Jones","Junio C Hamano","Jonathan Nieder","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"252391","messageId":"5471EC26.3040705@web.de","threadId":"38029","inReplyTo":null,"subject":"[PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-11-23T14:16:06Z","receivedAt":"2014-11-23T14:16:06Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"gcc under cygwin reports several warnings like this:\n warning: implicit declaration of function 'memmem'\n  [-Wimplicit-function-declaration]\nThis has been observed under CYGWIN-32 with GCC 4.7.3 as well\nas CYGWIN-64 with gcc v4.8.3-5 x86-64\n\nDo not #define _XOPEN_SOURCE 600 for CYGWIN.\n\nReported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\nThis may be a start for a patch, tested under CYGWIN-32,\nboth Windows7 and XP\n git-compat-util.h | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 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-- \n1.9.1.dirty\n"},{"id":"252394","messageId":"5472159B.4060905@ramsay1.demon.co.uk","threadId":"38029","inReplyTo":"5471EC26.3040705@web.de","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-11-23T17:12:59Z","receivedAt":"2014-11-23T17:12:59Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 23/11/14 14:16, Torsten Bögershausen wrote:\n> gcc under cygwin reports several warnings like this:\n>  warning: implicit declaration of function 'memmem'\n>   [-Wimplicit-function-declaration]\n> This has been observed under CYGWIN-32 with GCC 4.7.3 as well\n> as CYGWIN-64 with gcc v4.8.3-5 x86-64\n\nHeh, thanks for looking into this. Your email came at a good time,\nsince I was just about to boot my old laptop into windows XP to\ntest my patch on 32-bit cygwin! (If I had not been watching the\nF1 Grand Prix on TV, I would already have done so! ;-) ).\n\nIt's been a while since I updated my 32-bit cygwin installation\n(about 6 months) but I'm a little surprised you found this issue\nwith gcc 4.7.3 (I'm _almost_ tempted to boot that laptop anyway\njust to see what versions of software it is running).\n\nJust for the reccord, my patch follows.\n\nATB,\nRamsay Jones\n\n> \n> Do not #define _XOPEN_SOURCE 600 for CYGWIN.\n> \n> Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> ---\n> This may be a start for a patch, tested under CYGWIN-32,\n> both Windows7 and XP\n>  git-compat-util.h | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\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"},{"id":"252400","messageId":"xmqqegstychq.fsf@gitster.dls.corp.google.com","threadId":"38029","inReplyTo":"5472159B.4060905@ramsay1.demon.co.uk","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-23T18:53:53Z","receivedAt":"2014-11-23T18:53:53Z","isPatch":true,"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> On 23/11/14 14:16, Torsten Bögershausen wrote:\n>> gcc under cygwin reports several warnings like this:\n>>  warning: implicit declaration of function 'memmem'\n>>   [-Wimplicit-function-declaration]\n>> This has been observed under CYGWIN-32 with GCC 4.7.3 as well\n>> as CYGWIN-64 with gcc v4.8.3-5 x86-64\n>\n> Heh, thanks for looking into this. Your email came at a good time,\n> since I was just about to boot my old laptop into windows XP to\n> test my patch on 32-bit cygwin! (If I had not been watching the\n> F1 Grand Prix on TV, I would already have done so! ;-) ).\n>\n> It's been a while since I updated my 32-bit cygwin installation\n> (about 6 months) but I'm a little surprised you found this issue\n> with gcc 4.7.3 (I'm _almost_ tempted to boot that laptop anyway\n> just to see what versions of software it is running).\n\nSo you have an old installation to check how well the patched\nversion is accepted by the old set of header files?\n\n>\n> Just for the reccord, my patch follows.\n>\n> ATB,\n> Ramsay Jones\n>\n>> \n>> Do not #define _XOPEN_SOURCE 600 for CYGWIN.\n>> \n>> Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n>> ---\n>> This may be a start for a patch, tested under CYGWIN-32,\n>> both Windows7 and XP\n>>  git-compat-util.h | 3 ++-\n>>  1 file changed, 2 insertions(+), 1 deletion(-)\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"},{"id":"252412","messageId":"54726A8C.4040600@ramsay1.demon.co.uk","threadId":"38029","inReplyTo":"xmqqegstychq.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-11-23T23:15:24Z","receivedAt":"2014-11-23T23:15:24Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 23/11/14 18:53, Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n> \n>> On 23/11/14 14:16, Torsten Bögershausen wrote:\n>>> gcc under cygwin reports several warnings like this:\n>>>  warning: implicit declaration of function 'memmem'\n>>>   [-Wimplicit-function-declaration]\n>>> This has been observed under CYGWIN-32 with GCC 4.7.3 as well\n>>> as CYGWIN-64 with gcc v4.8.3-5 x86-64\n>>\n>> Heh, thanks for looking into this. Your email came at a good time,\n>> since I was just about to boot my old laptop into windows XP to\n>> test my patch on 32-bit cygwin! (If I had not been watching the\n>> F1 Grand Prix on TV, I would already have done so! ;-) ).\n>>\n>> It's been a while since I updated my 32-bit cygwin installation\n>> (about 6 months) but I'm a little surprised you found this issue\n>> with gcc 4.7.3 (I'm _almost_ tempted to boot that laptop anyway\n>> just to see what versions of software it is running).\n> \n> So you have an old installation to check how well the patched\n> version is accepted by the old set of header files?\n\n... I can, indeed, use this old installation to test this on\n32-bit cygwin. sigh, I thought I had dodged that bullet! ;-)\n\n[I can't do this tonight and I'm pretty busy tomorrow, so it\nmay have to wait until tomorrow evening at the earliest. sorry\nabout that. :( ]\n\nThis does not help much with 64-bit cygwin. They are effectively\ntwo different 'distributions'.\n\nATB,\nRamsay Jones\n"},{"id":"252417","messageId":"5472DC24.9010008@web.de","threadId":"38029","inReplyTo":"54726A8C.4040600@ramsay1.demon.co.uk","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-11-24T07:20:04Z","receivedAt":"2014-11-24T07:20:04Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2014-11-24 00.15, Ramsay Jones wrote:\n> On 23/11/14 18:53, Junio C Hamano wrote:\n>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>>\n>>> On 23/11/14 14:16, Torsten Bögershausen wrote:\n>>>> gcc under cygwin reports several warnings like this:\n>>>>  warning: implicit declaration of function 'memmem'\n>>>>   [-Wimplicit-function-declaration]\n>>>> This has been observed under CYGWIN-32 with GCC 4.7.3 as well\n>>>> as CYGWIN-64 with gcc v4.8.3-5 x86-64\n>>>\n>>> Heh, thanks for looking into this. Your email came at a good time,\n>>> since I was just about to boot my old laptop into windows XP to\n>>> test my patch on 32-bit cygwin! (If I had not been watching the\n>>> F1 Grand Prix on TV, I would already have done so! ;-) ).\n>>>\n>>> It's been a while since I updated my 32-bit cygwin installation\n>>> (about 6 months) but I'm a little surprised you found this issue\n>>> with gcc 4.7.3 (I'm _almost_ tempted to boot that laptop anyway\n>>> just to see what versions of software it is running).\n>>\n>> So you have an old installation to check how well the patched\n>> version is accepted by the old set of header files?\n> \n> ... I can, indeed, use this old installation to test this on\n> 32-bit cygwin. sigh, I thought I had dodged that bullet! ;-)\n> \n\nIt depends what we mean with \"old\":\ncygwin 1.5 is old, and I lost my test installation this summer:\nOne netbook was converted from XP to Linux, the other machine needs to be\nre-installed and CYGWIN 1.5 is no longer available for download.\n\nI can confirm that Ramsays patch works with CYGWIN 1.7 32 Bit.\n\n \n"},{"id":"252433","messageId":"54735638.9000502@web.de","threadId":"38029","inReplyTo":"5472DC24.9010008@web.de","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-11-24T16:00:56Z","receivedAt":"2014-11-24T16:00:56Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"> \n> It depends what we mean with \"old\":\n> cygwin 1.5 is old, and I lost my test installation this summer:\n> One netbook was converted from XP to Linux, the other machine needs to be\n> re-installed and CYGWIN 1.5 is no longer available for download.\n> \n> I can confirm that Ramsays patch works with CYGWIN 1.7 32 Bit.\nAnother update:\nThe test suite passes, except\nt5000 - not ok 48 - archive and :(glob)\n\nfatal: pathspec '*.abc' did not match any files\n"},{"id":"252435","messageId":"20141124175947.GN6527@google.com","threadId":"38029","inReplyTo":"5471EC26.3040705@web.de","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-11-24T17:59:47Z","receivedAt":"2014-11-24T17:59:47Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Torsten Bögershausen wrote:\n\n> gcc under cygwin reports several warnings like this:\n>\n>  warning: implicit declaration of function 'memmem'\n>   [-Wimplicit-function-declaration]\n>\n> This has been observed under CYGWIN-32 with GCC 4.7.3 as well\n> as CYGWIN-64 with gcc v4.8.3-5 x86-64\n>\n> Do not #define _XOPEN_SOURCE 600 for CYGWIN.\n>\n> Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n> ---\n> This may be a start for a patch, tested under CYGWIN-32,\n> both Windows7 and XP\n\nThe \"tested under\" part would also be a good addition to the commit\nmessage.\n\n>  git-compat-util.h | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n\nPatch looks good to me.  Do you know if this has been reported to the\nCygwin maintainers?  The behavior seems counterintuitive --- I would\nexpect _GNU_SOURCE to override everything else (since I thought that\nwas the point of _GNU_SOURCE).\n\nThanks,\nJonathan\n"},{"id":"252439","messageId":"54737911.2040502@kdbg.org","threadId":"38029","inReplyTo":"54735638.9000502@web.de","subject":"[PATCH] t5000 on Windows: do not mistake \"sh.exe\" as \"sh\"","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2014-11-24T18:29:37Z","receivedAt":"2014-11-24T18:29:37Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"In their effort to emulate POSIX as close as possible, the MSYS tools\nand Cygwin treat the file name \"foo.exe\" as \"foo\" when the latter is\nasked for, but not present, but the former is present.\n\nFollowing this rule, 'cp /bin/sh a/bin' actually copies the file\n/bin/sh.exe, so that we now have a/bin/sh.exe in the repository. This\ndifference did not matter in the tests in the past because we were only\ninterested in the equality of contents generated in various ways. But\nrecently added tests check file names, in particular, the presence of\n\"a/bin/sh\". This test fails on Windows, as we do not have a file by this\nname, but \"a/bin/sh.exe\".\n\nUse test-genrandom to generate the large binary file in the repository\nunder the expected name.\n\nWe could change the guilty line to 'cat /bin/sh >a/bin/sh', but it is\nbetter for test reproducibility to ensure that the test data is the same\nacross platforms, which test-genrandom can guarantee.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\nAm 24.11.2014 um 17:00 schrieb Torsten Bögershausen:\n> The test suite passes, except\n> t5000 - not ok 48 - archive and :(glob)\n> \n> fatal: pathspec '*.abc' did not match any files\n\nI've this patch in my tree for a while.\n\n t/t5000-tar-tree.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex d01bbdc..4b68bba 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -101,7 +101,7 @@ test_expect_success \\\n      ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n      echo long filename >a/four$hundred &&\n      mkdir a/bin &&\n-     cp /bin/sh a/bin &&\n+     test-genrandom \"frotz\" 500000 >a/bin/sh &&\n      printf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n      printf \"A not substituted O\" >a/substfile2 &&\n      if test_have_prereq SYMLINKS; then\n-- \n2.0.0.12.gbcf935e\n"},{"id":"252440","messageId":"54738451.1090604@web.de","threadId":"38029","inReplyTo":"20141124175947.GN6527@google.com","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-11-24T19:17:37Z","receivedAt":"2014-11-24T19:17:37Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"> \n> Patch looks good to me.  Do you know if this has been reported to the\n> Cygwin maintainers?  The behavior seems counterintuitive --- I would\n> expect _GNU_SOURCE to override everything else (since I thought that\n> was the point of _GNU_SOURCE).\nI don't know, it seems that CYGWIN is now in class with some BSD and Mac OS X.\nActually Ramsay did send a patch, so that this is obsolete now.\n"},{"id":"252443","messageId":"54738ED7.3000508@web.de","threadId":"38029","inReplyTo":"54737911.2040502@kdbg.org","subject":"Re: [PATCH] t5000 on Windows: do not mistake \"sh.exe\" as \"sh\"","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-11-24T20:02:31Z","receivedAt":"2014-11-24T20:02:31Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"> \n> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n> index d01bbdc..4b68bba 100755\n> --- a/t/t5000-tar-tree.sh\n> +++ b/t/t5000-tar-tree.sh\n> @@ -101,7 +101,7 @@ test_expect_success \\\n>       ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n>       echo long filename >a/four$hundred &&\n>       mkdir a/bin &&\n> -     cp /bin/sh a/bin &&\n> +     test-genrandom \"frotz\" 500000 >a/bin/sh &&\n\nThat's a fast respose :-)\nThe patch works for me, Thanks\n"},{"id":"252453","messageId":"5473A2D0.5010101@ramsay1.demon.co.uk","threadId":"38029","inReplyTo":"5472DC24.9010008@web.de","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-11-24T21:27:44Z","receivedAt":"2014-11-24T21:27:44Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 24/11/14 07:20, Torsten Bögershausen wrote:\n> On 2014-11-24 00.15, Ramsay Jones wrote:\n>> On 23/11/14 18:53, Junio C Hamano wrote:\n>>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>>>\n>>>> On 23/11/14 14:16, Torsten Bögershausen wrote:\n>>>>> gcc under cygwin reports several warnings like this:\n>>>>>  warning: implicit declaration of function 'memmem'\n>>>>>   [-Wimplicit-function-declaration]\n>>>>> This has been observed under CYGWIN-32 with GCC 4.7.3 as well\n>>>>> as CYGWIN-64 with gcc v4.8.3-5 x86-64\n>>>>\n>>>> Heh, thanks for looking into this. Your email came at a good time,\n>>>> since I was just about to boot my old laptop into windows XP to\n>>>> test my patch on 32-bit cygwin! (If I had not been watching the\n>>>> F1 Grand Prix on TV, I would already have done so! ;-) ).\n>>>>\n>>>> It's been a while since I updated my 32-bit cygwin installation\n>>>> (about 6 months) but I'm a little surprised you found this issue\n>>>> with gcc 4.7.3 (I'm _almost_ tempted to boot that laptop anyway\n>>>> just to see what versions of software it is running).\n>>>\n>>> So you have an old installation to check how well the patched\n>>> version is accepted by the old set of header files?\n>>\n>> ... I can, indeed, use this old installation to test this on\n>> 32-bit cygwin. sigh, I thought I had dodged that bullet! ;-)\n>>\n> \n> It depends what we mean with \"old\":\n> cygwin 1.5 is old, and I lost my test installation this summer:\n\nI updated from cygwin 1.5 to cygwin 1.7 at the beginning of the year.\nSince it is no longer supported, I don't think we need to worry about\nversion 1.5. When I said 'old installation' I meant my old version 1.7\n32-bit installation.\n\n> One netbook was converted from XP to Linux, the other machine needs to be\n> re-installed and CYGWIN 1.5 is no longer available for download.\n> \n> I can confirm that Ramsays patch works with CYGWIN 1.7 32 Bit.\n\nThanks!\n\nATB,\nRamsay Jones\n"},{"id":"252454","messageId":"5473A602.30505@ramsay1.demon.co.uk","threadId":"38029","inReplyTo":"20141124175947.GN6527@google.com","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-11-24T21:41:22Z","receivedAt":"2014-11-24T21:41:22Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 24/11/14 17:59, Jonathan Nieder wrote:\n> Torsten Bögershausen wrote:\n> \n>> gcc under cygwin reports several warnings like this:\n>>\n>>  warning: implicit declaration of function 'memmem'\n>>   [-Wimplicit-function-declaration]\n>>\n>> This has been observed under CYGWIN-32 with GCC 4.7.3 as well\n>> as CYGWIN-64 with gcc v4.8.3-5 x86-64\n>>\n>> Do not #define _XOPEN_SOURCE 600 for CYGWIN.\n>>\n>> Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>\n>> ---\n>> This may be a start for a patch, tested under CYGWIN-32,\n>> both Windows7 and XP\n> \n> The \"tested under\" part would also be a good addition to the commit\n> message.\n> \n>>  git-compat-util.h | 3 ++-\n>>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> Patch looks good to me.  Do you know if this has been reported to the\n> Cygwin maintainers?\n\nAs I said in an earlier email, I have searched the cygwin mailing list\n(a few days ago now), but this issue had not been mentioned (modulo my\npoor list searching fu!).\n\nHowever, since I don't want to subscribe to (yet another) busy mailing\nlist, I won't be reporting this issue there. (If someone on this list\nis already subscribed to that list, then ... ;-) ).\n\n>                       The behavior seems counterintuitive --- I would\n> expect _GNU_SOURCE to override everything else (since I thought that\n> was the point of _GNU_SOURCE).\n\nI had that impression too, but I need to read some more first.\n\nAlso, my theory about the cause of the problem has changed slightly\nthis evening, after booting up my old laptop and looking at an old\n32-bit cygwin installation.\n\nRather than a change to '..../sys/cdefs.h' which changed the priority\nof _XOPEN_SOURCE, it seems that it was the <string.h> header that\nchanged; those functions used to be declared unconditionally, whereas\nthe new headers have them within preprocessor conditionals.\n\nATB,\nRamsay Jones\n"},{"id":"252455","messageId":"xmqq7fykw9y5.fsf@gitster.dls.corp.google.com","threadId":"38029","inReplyTo":"5473A2D0.5010101@ramsay1.demon.co.uk","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-24T21:44:02Z","receivedAt":"2014-11-24T21:44:02Z","isPatch":true,"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> I updated from cygwin 1.5 to cygwin 1.7 at the beginning of the year.\n> Since it is no longer supported, I don't think we need to worry about\n> version 1.5. When I said 'old installation' I meant my old version 1.7\n> 32-bit installation.\n>\n>> One netbook was converted from XP to Linux, the other machine needs to be\n>> re-installed and CYGWIN 1.5 is no longer available for download.\n>> \n>> I can confirm that Ramsays patch works with CYGWIN 1.7 32 Bit.\n>\n> Thanks!\n\nThanks.  So the unconditional version of the patch is good to go, I\ntake?\n"},{"id":"252462","messageId":"5473B0E4.9090900@ramsay1.demon.co.uk","threadId":"38029","inReplyTo":"54726A8C.4040600@ramsay1.demon.co.uk","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-11-24T22:27:48Z","receivedAt":"2014-11-24T22:27:48Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 23/11/14 23:15, Ramsay Jones wrote:\n> On 23/11/14 18:53, Junio C Hamano wrote:\n>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n>>\n>>> On 23/11/14 14:16, Torsten Bögershausen wrote:\n>>>> gcc under cygwin reports several warnings like this:\n>>>>  warning: implicit declaration of function 'memmem'\n>>>>   [-Wimplicit-function-declaration]\n>>>> This has been observed under CYGWIN-32 with GCC 4.7.3 as well\n>>>> as CYGWIN-64 with gcc v4.8.3-5 x86-64\n>>>\n>>> Heh, thanks for looking into this. Your email came at a good time,\n>>> since I was just about to boot my old laptop into windows XP to\n>>> test my patch on 32-bit cygwin! (If I had not been watching the\n>>> F1 Grand Prix on TV, I would already have done so! ;-) ).\n>>>\n>>> It's been a while since I updated my 32-bit cygwin installation\n>>> (about 6 months) but I'm a little surprised you found this issue\n>>> with gcc 4.7.3 (I'm _almost_ tempted to boot that laptop anyway\n>>> just to see what versions of software it is running).\n>>\n>> So you have an old installation to check how well the patched\n>> version is accepted by the old set of header files?\n> \n> ... I can, indeed, use this old installation to test this on\n> 32-bit cygwin. sigh, I thought I had dodged that bullet! ;-)\n> \n> [I can't do this tonight and I'm pretty busy tomorrow, so it\n> may have to wait until tomorrow evening at the earliest. sorry\n> about that. :( ]\n\nOK, so I had a look tonight and, as I told Jonathan earlier, my\ntheory for the cause of the issue has changed slightly.\n\nFirst, I simply re-built git to make sure this issue wasn't present\n(I would have been shocked if it was, but ...) and it was fine.\nThe master branch was at commit 7b69fcb (aka Git 2.1.0-rc1).\nI applied my patch to this commit and re-built, again with no\nproblem. I then fetched the current version of git (i.e. commit\n652e759 aka Git 2.2.0-rc3) and re-built; no problem. Finally, after\napplying my patch to this commit, once again the build was free\nfrom problems.\n\nNote that I have not run any tests (it takes far too long), simply\na full build (make clean; make).\n\nSome other things to note:\n\n  $ uname -a\n  CYGWIN_NT-5.1 toshiba 1.7.30(0.272/5/3) 2014-05-23 10:36 i686 Cygwin\n\n  $ gcc --version\n  gcc (GCC) 4.8.3\n  Copyright (C) 2013 Free Software Foundation, Inc.\n  This is free software; see the source for copying conditions.  There is NO\n  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n  $ ls -l /cygdrive/c/Documents\\ and\\ Settings/ramsay/Downloads/http%3a     %2f%2fmirrors.kernel.org%2fsourceware%2fcygwin%2f/x86/release/gcc/gcc-core/\n  total 38M\n  -rwx------+ 1 ramsay None 13M Nov 10  2013 gcc-core-4.8.2-1.tar.xz*\n  -rwx------+ 1 ramsay None 13M Dec 22  2013 gcc-core-4.8.2-2.tar.xz*\n  -rw-r--r--  1 ramsay None 13M Jun  3 13:06 gcc-core-4.8.3-1.tar.xz\n  $ # ie this is the first build of the compiler package for v4.8.3\n\n  $ cygcheck -f /usr/include/string.h\n  cygwin-1.7.30-1\n  $ cygcheck -f /usr/include/sys/cdefs.h\n  cygwin-1.7.30-1\n\n  $ ls /usr/lib/gcc/i686-pc-cygwin/4.8.3/include-fixed/\n  limits.h  README  syslimits.h\n\nWhile on my (new) 64-bit installation:\n\n  $ uname -a\n  CYGWIN_NT-6.3 satellite 1.7.33-2(0.280/5/3) 2014-11-13 15:47 x86_64 Cygwin\n  $ gcc --version\n  gcc (GCC) 4.8.3\n  Copyright (C) 2013 Free Software Foundation, Inc.\n  This is free software; see the source for copying conditions.  There is NO\n  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n  $ ls -l /cygdrive/c/Users/ramsay/Downloads/http%3a%2f%2fmirrors.kernel.org%2fsourceware%2fcygwin%2f/x86_64/release/gcc/gcc-core/\n  total 66M\n  -rw-r--r-- 1 ramsay None 13M May 18  2014 gcc-core-4.8.2-3.tar.xz\n  -rw-r--r-- 1 ramsay None 13M Jun  7 00:06 gcc-core-4.8.3-2.tar.xz\n  -rw-r--r-- 1 ramsay None 14M Aug 30 22:48 gcc-core-4.8.3-3.tar.xz\n  -rw-r--r-- 1 ramsay None 14M Nov 12 20:19 gcc-core-4.8.3-4.tar.xz\n  -rw-r--r-- 1 ramsay None 14M Nov 20 13:07 gcc-core-4.8.3-5.tar.xz\n  $ # ie this is the fifth build of the compiler package for v4.8.3\n\n  $ cygcheck -f /usr/include/string.h\n  cygwin-devel-1.7.33-1\n  $ cygcheck -f /usr/include/sys/cdefs.h\n  cygwin-devel-1.7.33-1\n  $ cygcheck -f /usr/lib/gcc/x86_64-pc-cygwin/4.8.3/include-fixed/sys/cdefs.h\n  gcc-core-4.8.3-5\n  $ \n\nAlthough I have not done an actual diff of the various cdef.h files, they\ndo appear to be more or less the same. In other words, I no longer think\nthat the change results from a 'change in priority of _XOPEN_SOURCE'. The\nissue is simply that in the old <string.h> header these functions were\ndeclared unconditionally; in the new headers the are contained within\npreprocessor conditionals using the __GNU_VISIBLE and __BSD_VISIBLE macros\nwhich are not set when _XOPEN_SOURCE is set (despite _GNU_SOURCE and\n_BSD_SOURCE being set).\n\nATB,\nRamsay Jones\n"},{"id":"252464","messageId":"xmqqlhn0usbq.fsf@gitster.dls.corp.google.com","threadId":"38029","inReplyTo":"5473B0E4.9090900@ramsay1.demon.co.uk","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-24T22:50:01Z","receivedAt":"2014-11-24T22:50:01Z","isPatch":true,"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> ...\n> Although I have not done an actual diff of the various cdef.h files, they\n> do appear to be more or less the same. In other words, I no longer think\n> that the change results from a 'change in priority of _XOPEN_SOURCE'. The\n> issue is simply that in the old <string.h> header these functions were\n> declared unconditionally; in the new headers the are contained within\n> preprocessor conditionals using the __GNU_VISIBLE and __BSD_VISIBLE macros\n> which are not set when _XOPEN_SOURCE is set (despite _GNU_SOURCE and\n> _BSD_SOURCE being set).\n\nSo I can take your version [*1*], drop this bit from the log:\n\n    This seems to be caused by a change to the system headers which\n    results in the _XOPEN_SOURCE macro now having prioity over the\n    _GNU_SOURCE and _BSD_SOURCE macros (they are simply ignored).\n    This in turn leads to the declarations of the above functions\n    to be suppressed.\n\nand replace it with something like:\n\n    <string.h> on Cygwin used to always declare the above functions,\n    but a recent version of it no longer make them visible when\n    _XOPEN_SOURCE is set (even if _GNU_SOURCE and _BSD_SOURCE is\n    set).\n\nand keep the rest, I think.\n\nThanks for digging this thoroughly.\n\n\n[Reference]\n\n*1* http://article.gmane.org/gmane.comp.version-control.git/260091\n"},{"id":"252466","messageId":"5473B856.5000205@ramsay1.demon.co.uk","threadId":"38029","inReplyTo":"xmqq7fykw9y5.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-11-24T22:59:34Z","receivedAt":"2014-11-24T22:59:34Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 24/11/14 21:44, Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n> \n>> I updated from cygwin 1.5 to cygwin 1.7 at the beginning of the year.\n>> Since it is no longer supported, I don't think we need to worry about\n>> version 1.5. When I said 'old installation' I meant my old version 1.7\n>> 32-bit installation.\n>>\n>>> One netbook was converted from XP to Linux, the other machine needs to be\n>>> re-installed and CYGWIN 1.5 is no longer available for download.\n>>>\n>>> I can confirm that Ramsays patch works with CYGWIN 1.7 32 Bit.\n>>\n>> Thanks!\n> \n> Thanks.  So the unconditional version of the patch is good to go, I\n> take?\n> \n\nHmm, I don't know what you mean by 'unconditional version'. ;-)\n\nAnyway, the commit message of my patch needs some edits to reflect\nmy new 'theory' of the cause. I suppose I should try to track down\nthe changes to the cygwin headers to be more confident that I have\nactually identified the correct cause. (Like Jonathan, I'm still a\nbit surprised that _GNU_SOURCE doesn't trump _XOPEN_SOURCE, but I\ncan't say that it is a bug).\n\nHowever, I suspect that the patch as is, modulo commit message edits,\nshould be sufficient to fix this up (at least for now).\n\nATB,\nRamsay Jones\n"},{"id":"252469","messageId":"5473B999.2050604@ramsay1.demon.co.uk","threadId":"38029","inReplyTo":"xmqqlhn0usbq.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH RFC] CYGWIN: avoid implicit declaration warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2014-11-24T23:04:57Z","receivedAt":"2014-11-24T23:04:57Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"On 24/11/14 22:50, Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n> \n>> ...\n>> Although I have not done an actual diff of the various cdef.h files, they\n>> do appear to be more or less the same. In other words, I no longer think\n>> that the change results from a 'change in priority of _XOPEN_SOURCE'. The\n>> issue is simply that in the old <string.h> header these functions were\n>> declared unconditionally; in the new headers the are contained within\n>> preprocessor conditionals using the __GNU_VISIBLE and __BSD_VISIBLE macros\n>> which are not set when _XOPEN_SOURCE is set (despite _GNU_SOURCE and\n>> _BSD_SOURCE being set).\n> \n> So I can take your version [*1*], drop this bit from the log:\n> \n>     This seems to be caused by a change to the system headers which\n>     results in the _XOPEN_SOURCE macro now having prioity over the\n>     _GNU_SOURCE and _BSD_SOURCE macros (they are simply ignored).\n>     This in turn leads to the declarations of the above functions\n>     to be suppressed.\n> \n> and replace it with something like:\n> \n>     <string.h> on Cygwin used to always declare the above functions,\n>     but a recent version of it no longer make them visible when\n>     _XOPEN_SOURCE is set (even if _GNU_SOURCE and _BSD_SOURCE is\n>     set).\n> \n> and keep the rest, I think.\n\nPerfect! Thanks! (actually, another minor typo: the second warning\nmessage, indent the ^ by two spaces - it should be pointing to the\n= symbol).\n\nATB,\nRamsay Jones\n"}]}