Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7bc9a8b

Browse files
committed
Fix warnings about declaration of environ on MinGW.
POSIX says that the global variable environ shouldn't be declared in aheader, and that you have to declare it yourself. MinGW declares it in<stdlib.h> with some macrology that messes up our declarations. VisualStudio doesn't warn (there are clues that it may also declare it, but ifso, apparently compatibly). Suppress our declarations, on MinGW only.This clears the last warnings on CI's optional MinGW task, and hopefullyon build farm animal fairywren too.Like1319997, no back-patch for now as it's not known to be breakinganything, and my humble goal is just to keep the MinGW build clean goingforward.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (earlier version)Discussion:https://postgr.es/m/CA%2BhUKGJLMh%2B6W5E4M_jSFb43gnrA_-Q6-%2BBf3HkBXyGfRFcBsQ%40mail.gmail.com
1 parent48c142f commit7bc9a8b

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,9 @@ PostmasterMain(int argc, char *argv[])
854854
/* For debugging: display postmaster environment */
855855
if (message_level_is_interesting(DEBUG3))
856856
{
857+
#if !defined(WIN32)|| defined(_MSC_VER)
857858
externchar**environ;
859+
#endif
858860
char**p;
859861
StringInfoDatasi;
860862

‎src/backend/utils/misc/ps_status.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
#include"utils/guc.h"
2424
#include"utils/ps_status.h"
2525

26+
#if !defined(WIN32)|| defined(_MSC_VER)
2627
externchar**environ;
28+
#endif
2729

2830
/* GUC variable */
2931
boolupdate_process_title=DEFAULT_UPDATE_PROCESS_TITLE;

‎src/test/regress/regress.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,9 @@ PG_FUNCTION_INFO_V1(get_environ);
647647
Datum
648648
get_environ(PG_FUNCTION_ARGS)
649649
{
650+
#if !defined(WIN32)|| defined(_MSC_VER)
650651
externchar**environ;
652+
#endif
651653
intnvals=0;
652654
ArrayType*result;
653655
Datum*env;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp