git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] mingw: drop bogus (and unneeded) declaration of `_pgmptr`

From
Mike Hommey <mh@glandium.org>
Date
Jun 20, 2024, 10:51 UTC
Message-ID
<20240620105105.5xv2ywxzzye4wjtk@glandium.org>
In-Reply-To
<pull.1752.git.1718777398765.gitgitgadget@gmail.com>
On Wed, Jun 19, 2024 at 06:09:58AM +0000, Johannes Schindelin via GitGitGadget wrote:
Show 29 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> In 08809c09aa13 (mingw: add a helper function to attach GDB to the
> current process, 2020-02-13), I added a declaration that was not needed.
> Back then, that did not matter, but now that the declaration of that
> symbol was changed in mingw-w64's headers, it causes the following
> compile error:
> 
>       CC compat/mingw.o
>   compat/mingw.c: In function 'open_in_gdb':
>   compat/mingw.c:35:9: error: function declaration isn't a prototype [-Werror=strict-prototypes]
>      35 |         extern char *_pgmptr;
>         |         ^~~~~~
>   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,
>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/xmmintrin.h:34,
>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/immintrin.h:31,
>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/x86intrin.h:32,
>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/winnt.h:1658,
>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/minwindef.h:163,
>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/windef.h:9,
>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/windows.h:69,
>                    from C:/git-sdk-64/usr/src/git/build-installers/mingw64/include/winsock2.h:23,
>                    from compat/../git-compat-util.h:215,
>                    from compat/mingw.c:1:
>   compat/mingw.c:35:22: error: '__p__pgmptr' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
>      35 |         extern char *_pgmptr;
>         |                      ^~~~~~~
> 
> Let's just drop the declaration and get rid of this compile error.

I can only suppose it gets rid of the compiler error with close to 100% certainty because for some reason, it only happens intermittently for me and I don't know whether I'm lucky or if the issue is fixed for real, but what it absolutely sure is that it doesn't break anything.

Mike
Previous: Johannes Schindelin via GitGitGadgetNext: Junio C Hamano
Message 2 of 3 in “mingw: drop bogus (and unneeded) declaration of `_pgmptr`”
  1. mingw: drop bogus (and unneeded) declaration of `_pgmptr`Johannes Schindelin via GitGitGadget, Jun 19, 2024
  2. Mike HommeyJun 20, 2024
  3. Junio C HamanoJun 20, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.