Re: _CRT_glob stuff
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Jacob Champion <jacob.champion@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-09-19T07:37:46Z
Lists: pgsql-hackers
On 18.09.25 17:15, Jacob Champion wrote: > On Thu, Sep 18, 2025 at 3:03 AM Peter Eisentraut <peter@eisentraut.org> wrote: >> Here is some relevant documentation that suggests that this is the >> correct approach: >> >> https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/crt/_mingw.h.in#L476 >> >> This also says that the default is 0 anyway, so it's not clear whether >> this is even useful anymore. The commit that introduced this (commit >> b787c554c26) is from 2022, so it's not that long ago. (It appears to be >> some old mingw vs. new mingw issue?) > > So if MinGW already defines its own version of this symbol [1], how > does this work in practice? Would it actually do anything if we > assigned -1 instead? Yes, if you do that, the pg_amcheck test 'schema exclusion pattern overrides all inclusion patterns' fails, which has an entirely plausible causality. As to how it works, I'm not sure, but I suppose the linker somehow arranges the initializations in the right order.
Commits
-
Fix compiler warnings around _CRT_glob
- 3e908fb54ff8 19 (unreleased) landed
-
Inhibit mingw CRT's auto-globbing of command line arguments
- b787c554c264 15.0 cited