Skip to content

mingw: drop bogus (and unneeded) declaration of _pgmptr #1752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dscho
Copy link
Member

@dscho dscho commented Jun 18, 2024

In 08809c0 (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 <[email protected]>
@dscho dscho self-assigned this Jun 18, 2024
@dscho dscho marked this pull request as ready for review June 19, 2024 06:08
@dscho
Copy link
Member Author

dscho commented Jun 19, 2024

/submit

Copy link

gitgitgadget bot commented Jun 19, 2024

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1752/dscho/drop-bogus-_pgmptr-declaration-v1

To fetch this version to local tag pr-1752/dscho/drop-bogus-_pgmptr-declaration-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1752/dscho/drop-bogus-_pgmptr-declaration-v1

Copy link

gitgitgadget bot commented Jun 20, 2024

On the Git mailing list, Mike Hommey wrote (reply to this):

On Wed, Jun 19, 2024 at 06:09:58AM +0000, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <[email protected]>
> 
> 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

Copy link

gitgitgadget bot commented Jun 20, 2024

User Mike Hommey <[email protected]> has been added to the cc: list.

Copy link

gitgitgadget bot commented Jun 20, 2024

On the Git mailing list, Junio C Hamano wrote (reply to this):

Mike Hommey <[email protected]> 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.

Copy link

gitgitgadget bot commented Jun 20, 2024

This branch is now known as js/mingw-remove-unused-extern-decl.

Copy link

gitgitgadget bot commented Jun 20, 2024

This patch series was integrated into seen via git@06ec1e8.

Copy link

gitgitgadget bot commented Jun 20, 2024

This patch series was integrated into next via git@65b3239.

Copy link

gitgitgadget bot commented Jun 21, 2024

There was a status update in the "New Topics" section about the branch js/mingw-remove-unused-extern-decl on the Git mailing list:

An unused extern declaration for mingw has been removed to prevent
it from causing build failure.

Will merge to 'master'.
source: <[email protected]>

dscho added a commit to git-for-windows/git that referenced this pull request Jun 21, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 21, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 21, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 21, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 21, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 22, 2024
Copy link

gitgitgadget bot commented Jun 22, 2024

This patch series was integrated into seen via git@5257207.

git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 22, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 23, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 25, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 25, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 25, 2024
Copy link

gitgitgadget bot commented Jun 25, 2024

This patch series was integrated into seen via git@b62c197.

Copy link

gitgitgadget bot commented Jun 25, 2024

There was a status update in the "Cooking" section about the branch js/mingw-remove-unused-extern-decl on the Git mailing list:

An unused extern declaration for mingw has been removed to prevent
it from causing build failure.

Will merge to 'master'.
source: <[email protected]>

Copy link

gitgitgadget bot commented Jun 25, 2024

This patch series was integrated into seen via git@553af1f.

Copy link

gitgitgadget bot commented Jun 26, 2024

This patch series was integrated into seen via git@0b0307e.

git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 26, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 26, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 26, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 26, 2024
Copy link

gitgitgadget bot commented Jun 26, 2024

This patch series was integrated into seen via git@55b59b6.

git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 27, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 27, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 27, 2024
Copy link

gitgitgadget bot commented Jun 27, 2024

This patch series was integrated into seen via git@424a13d.

Copy link

gitgitgadget bot commented Jun 27, 2024

This patch series was integrated into master via git@424a13d.

Copy link

gitgitgadget bot commented Jun 27, 2024

This patch series was integrated into next via git@424a13d.

@gitgitgadget gitgitgadget bot added the master label Jun 27, 2024
@gitgitgadget gitgitgadget bot closed this Jun 27, 2024
Copy link

gitgitgadget bot commented Jun 27, 2024

Closed via 424a13d.

@dscho dscho deleted the drop-bogus-_pgmptr-declaration branch June 28, 2024 07:33
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 29, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jun 29, 2024
dscho added a commit to microsoft/git that referenced this pull request Jul 1, 2024
In 08809c0 (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.

This PR integrates the fix early that had been contributed in
gitgitgadget#1752 and was already integrated
early into Git for Windows via
git-for-windows#5017.
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 2, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 2, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 2, 2024
dscho added a commit to git-for-windows/git that referenced this pull request Jul 2, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 4, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 4, 2024
git-for-windows-ci pushed a commit to git-for-windows/git that referenced this pull request Jul 10, 2024
dscho added a commit to microsoft/git that referenced this pull request Jul 17, 2024
In 08809c0 (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.

This PR integrates the fix early that had been contributed in
gitgitgadget#1752 and was already integrated
early into Git for Windows via
git-for-windows#5017.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant