postgres.git / summary / log / commit / refs

commit    0f8a2b133644b3cf17a54c10153ba7941d0d8936
Author:   Andres Freund <andres@anarazel.de>
Date:     Tue Nov 04 18:24:57 2025 +0000
First released in: 13.23, 14.20, 15.15, 16.11, 17.7

    Backpatch: Fix warnings about declaration of environ on MinGW
    
    Backpatch commit 7bc9a8bdd2d to 13-17. The motivation for backpatching is that
    we want to update CI to Debian Trixie. Trixie contains a newer mingw
    installation, which would trigger the warning addressed by 7bc9a8bdd2d. The
    risk of backpatching seems fairly low, given that it did not cause issues in
    the branches the commit is already present.
    
    While CI is not present in 13-14, it seems better to be consistent across
    branches.
    
    Author: Thomas Munro <tmunro@postgresql.org>
    Discussion: https://postgr.es/m/o5yadhhmyjo53svzwvaocww6zkrp63i4f32cw3treuh46pxtza@hyqio5b2tkt6
    Backpatch-through: 13


src/backend/postmaster/postmaster.c | 2 ++ src/backend/utils/misc/ps_status.c | 2 ++ src/test/regress/regress.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index d032091495b..d981bc76edf 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -859,7 +859,9 @@ PostmasterMain(int argc, char *argv[]) /* For debugging: display postmaster environment */ { +#if !defined(WIN32) || defined(_MSC_VER) extern char **environ; +#endif char **p; ereport(DEBUG3, diff --git a/src/backend/utils/misc/ps_status.c b/src/backend/utils/misc/ps_status.c index 9da63774020..27798dc51e1 100644 --- a/src/backend/utils/misc/ps_status.c +++ b/src/backend/utils/misc/ps_status.c @@ -23,7 +23,9 @@ #include "utils/guc.h" #include "utils/ps_status.h" +#if !defined(WIN32) || defined(_MSC_VER) extern char **environ; +#endif /* GUC variable */ bool update_process_title = DEFAULT_UPDATE_PROCESS_TITLE; diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c index 423add66502..f200dfb4411 100644 --- a/src/test/regress/regress.c +++ b/src/test/regress/regress.c @@ -650,7 +650,9 @@ PG_FUNCTION_INFO_V1(get_environ); Datum get_environ(PG_FUNCTION_ARGS) { +#if !defined(WIN32) || defined(_MSC_VER) extern char **environ; +#endif int nvals = 0; ArrayType *result; Datum *env; [parent: e1e79791af1c]