{"thread":{"id":"61647","subject":"[PATCH] mingw: drop bogus (and unneeded) declaration of `_pgmptr`","startedAt":"2024-06-19T06:10:01Z","lastAt":"2024-06-20T17:58:57Z","messageCount":3,"participants":["Johannes Schindelin via GitGitGadget","Mike Hommey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"497331","messageId":"pull.1752.git.1718777398765.gitgitgadget@gmail.com","threadId":"61647","inReplyTo":null,"subject":"[PATCH] mingw: drop bogus (and unneeded) declaration of `_pgmptr`","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-06-19T06:09:58Z","receivedAt":"2024-06-19T06:10:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nIn 08809c09aa13 (mingw: add a helper function to attach GDB to the\ncurrent process, 2020-02-13), I added a declaration that was not needed.\nBack then, that did not matter, but now that the declaration of that\nsymbol was changed in mingw-w64's headers, it causes the following\ncompile error:\n\n      CC compat/mingw.o\n  compat/mingw.c: In function 'open_in_gdb':\n  compat/mingw.c:35:9: error: function declaration isn't a prototype [-Werror=strict-prototypes]\n     35 |         extern char *_pgmptr;\n        |         ^~~~~~\n  In file included from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/mm_malloc.h:27,\n                   from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/xmmintrin.h:34,\n                   from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/immintrin.h:31,\n                   from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/x86intrin.h:32,\n                   from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/winnt.h:1658,\n                   from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/minwindef.h:163,\n                   from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/windef.h:9,\n                   from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/windows.h:69,\n                   from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/winsock2.h:23,\n                   from compat/../git-compat-util.h:215,\n                   from compat/mingw.c:1:\n  compat/mingw.c:35:22: error: '__p__pgmptr' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]\n     35 |         extern char *_pgmptr;\n        |                      ^~~~~~~\n\nLet's just drop the declaration and get rid of this compile error.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    mingw: drop bogus (and unneeded) declaration of _pgmptr\n    \n    Ran into this in\n    https://github.com/git-for-windows/git-sdk-64/actions/runs/9558244721/job/26346637793.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1752%2Fdscho%2Fdrop-bogus-_pgmptr-declaration-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1752/dscho/drop-bogus-_pgmptr-declaration-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1752\n\n compat/mingw.c | 1 -\n 1 file changed, 1 deletion(-)\n\ndiff --git a/compat/mingw.c b/compat/mingw.c\nindex 6b36d0387aa..41d8ca335d2 100644\n--- a/compat/mingw.c\n+++ b/compat/mingw.c\n@@ -16,7 +16,6 @@ static const int delay[] = { 0, 1, 10, 20, 40 };\n void open_in_gdb(void)\n {\n \tstatic struct child_process cp = CHILD_PROCESS_INIT;\n-\textern char *_pgmptr;\n \n \targv_array_pushl(&cp.args, \"mintty\", \"gdb\", NULL);\n \targv_array_pushf(&cp.args, \"--pid=%d\", getpid());\n\nbase-commit: 08809c09aa1351b603e9c55734105cd2e3c24c41\n-- \ngitgitgadget\n"},{"id":"497396","messageId":"20240620105105.5xv2ywxzzye4wjtk@glandium.org","threadId":"61647","inReplyTo":"pull.1752.git.1718777398765.gitgitgadget@gmail.com","subject":"Re: [PATCH] mingw: drop bogus (and unneeded) declaration of `_pgmptr`","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2024-06-20T10:51:05Z","receivedAt":"2024-06-20T10:51:15Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Wed, Jun 19, 2024 at 06:09:58AM +0000, Johannes Schindelin via GitGitGadget wrote:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> \n> In 08809c09aa13 (mingw: add a helper function to attach GDB to the\n> current process, 2020-02-13), I added a declaration that was not needed.\n> Back then, that did not matter, but now that the declaration of that\n> symbol was changed in mingw-w64's headers, it causes the following\n> compile error:\n> \n>       CC compat/mingw.o\n>   compat/mingw.c: In function 'open_in_gdb':\n>   compat/mingw.c:35:9: error: function declaration isn't a prototype [-Werror=strict-prototypes]\n>      35 |         extern char *_pgmptr;\n>         |         ^~~~~~\n>   In file included from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/mm_malloc.h:27,\n>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/xmmintrin.h:34,\n>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/immintrin.h:31,\n>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/x86intrin.h:32,\n>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/winnt.h:1658,\n>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/minwindef.h:163,\n>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/windef.h:9,\n>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/windows.h:69,\n>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/winsock2.h:23,\n>                    from compat/../git-compat-util.h:215,\n>                    from compat/mingw.c:1:\n>   compat/mingw.c:35:22: error: '__p__pgmptr' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]\n>      35 |         extern char *_pgmptr;\n>         |                      ^~~~~~~\n> \n> Let's just drop the declaration and get rid of this compile error.\n\nI can only suppose it gets rid of the compiler error with close to 100%\ncertainty because for some reason, it only happens intermittently for me\nand I don't know whether I'm lucky or if the issue is fixed for real,\nbut what it absolutely sure is that it doesn't break anything.\n\nMike\n"},{"id":"497419","messageId":"xmqqzfrfv6lg.fsf@gitster.g","threadId":"61647","inReplyTo":"20240620105105.5xv2ywxzzye4wjtk@glandium.org","subject":"Re: [PATCH] mingw: drop bogus (and unneeded) declaration of `_pgmptr`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-06-20T17:58:51Z","receivedAt":"2024-06-20T17:58:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mike Hommey <mh@glandium.org> writes:\n\n> I can only suppose it gets rid of the compiler error with close to 100%\n> certainty because for some reason, it only happens intermittently for me\n> and I don't know whether I'm lucky or if the issue is fixed for real,\n> but what it absolutely sure is that it doesn't break anything.\n\nThat is a curious vote of confidence ;-)  Will queue.  Thanks, both.\n"}]}