Skip to content

Weird intermittent compilation error related to _pgmptr #5016

@glandium

Description

@glandium
  • I was not able to find an open or closed issue matching what I'm seeing

I'm building parts of git-for-windows as part of git-cinnabar and am currently getting the following error intermittently:

    In file included from D:/a/git-cinnabar/git-cinnabar/src/mingw.c:11:
    D:/a/git-cinnabar/git-cinnabar/git-core/compat/mingw.c: In function 'open_in_gdb':
    D:/a/git-cinnabar/git-cinnabar/git-core/compat/mingw.c:35:9: error: function declaration isn't a prototype [-Werror=strict-prototypes]
       35 |         extern char *_pgmptr;
          |         ^~~~~~
    In file included from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/mm_malloc.h:27,
                     from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/xmmintrin.h:34,
                     from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/immintrin.h:31,
                     from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/14.1.0/include/x86intrin.h:32,
                     from C:/msys64/mingw64/include/winnt.h:1658,
                     from C:/msys64/mingw64/include/minwindef.h:163,
                     from C:/msys64/mingw64/include/windef.h:9,
                     from C:/msys64/mingw64/include/windows.h:69,
                     from C:/msys64/mingw64/include/winsock2.h:23,
                     from D:/a/git-cinnabar/git-cinnabar/git-core/git-compat-util.h:215,
                     from D:/a/git-cinnabar/git-cinnabar/git-core/compat/mingw.c:1:
    D:/a/git-cinnabar/git-cinnabar/git-core/compat/mingw.c:35:22: error: '__p__pgmptr' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
       35 |         extern char *_pgmptr;
          |                      ^~~~~~~
    cc1.exe: all warnings being treated as errors
    make: *** [D:\a\git-cinnabar\git-cinnabar\src\build.mk:143: mingw.o] Error 1
    make: *** Waiting for unfinished jobs....

The intermittence may or may not come from github actions caching, but the error is plain weird.

This is using a fresh-ish msys2 environment, and I suspect something changed recently in some of the mingw headers that causes problems with _pgmptr.

On the other hand, it doesn't even seem to be used at all? So I'm wondering what it's doing there in the first place?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions