* [PATCH] mingw: drop bogus (and unneeded) declaration of `_pgmptr`
@ 2024-06-19 6:09 Johannes Schindelin via GitGitGadget
2024-06-20 10:51 ` Mike Hommey
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2024-06-19 6:09 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin, Johannes Schindelin
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.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
mingw: drop bogus (and unneeded) declaration of _pgmptr
Ran into this in
https://github.com/git-for-windows/git-sdk-64/actions/runs/9558244721/job/26346637793.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1752%2Fdscho%2Fdrop-bogus-_pgmptr-declaration-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1752/dscho/drop-bogus-_pgmptr-declaration-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1752
compat/mingw.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/compat/mingw.c b/compat/mingw.c
index 6b36d0387aa..41d8ca335d2 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -16,7 +16,6 @@ static const int delay[] = { 0, 1, 10, 20, 40 };
void open_in_gdb(void)
{
static struct child_process cp = CHILD_PROCESS_INIT;
- extern char *_pgmptr;
argv_array_pushl(&cp.args, "mintty", "gdb", NULL);
argv_array_pushf(&cp.args, "--pid=%d", getpid());
base-commit: 08809c09aa1351b603e9c55734105cd2e3c24c41
--
gitgitgadget
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mingw: drop bogus (and unneeded) declaration of `_pgmptr`
2024-06-19 6:09 [PATCH] mingw: drop bogus (and unneeded) declaration of `_pgmptr` Johannes Schindelin via GitGitGadget
@ 2024-06-20 10:51 ` Mike Hommey
2024-06-20 17:58 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Mike Hommey @ 2024-06-20 10:51 UTC (permalink / raw)
To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin
On Wed, Jun 19, 2024 at 06:09:58AM +0000, Johannes Schindelin via GitGitGadget wrote:
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mingw: drop bogus (and unneeded) declaration of `_pgmptr`
2024-06-20 10:51 ` Mike Hommey
@ 2024-06-20 17:58 ` Junio C Hamano
0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2024-06-20 17:58 UTC (permalink / raw)
To: Mike Hommey
Cc: Johannes Schindelin via GitGitGadget, git, Johannes Schindelin
Mike Hommey <mh@glandium.org> writes:
> 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.
That is a curious vote of confidence ;-) Will queue. Thanks, both.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-20 17:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-19 6:09 [PATCH] mingw: drop bogus (and unneeded) declaration of `_pgmptr` Johannes Schindelin via GitGitGadget
2024-06-20 10:51 ` Mike Hommey
2024-06-20 17:58 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.