Re: [PATCH] pg_regress.c: Fix "make check" on Mac OS X: Pass DYLD_LIBRARY_PATH - Mailing list pgsql-hackers

From David Zhang
Subject Re: [PATCH] pg_regress.c: Fix "make check" on Mac OS X: Pass DYLD_LIBRARY_PATH
Date
Msg-id 168695071271.357334.2585593529574745046.pgcf@coridan.postgresql.org
Whole thread Raw
In response to Re: [PATCH] pg_regress.c: Fix "make check" on Mac OS X: Pass DYLD_LIBRARY_PATH  (Michael Paquier <michael@paquier.xyz>)
Responses Re: [PATCH] pg_regress.c: Fix "make check" on Mac OS X: Pass DYLD_LIBRARY_PATH  (David Zhang <david.zhang@highgo.ca>)
List pgsql-hackers
I have applied the patch to the latest master branch and successfully executed './configure && make && make check' on
macOSVentura. However, during the process, a warning was encountered: "mixing declarations and code is incompatible
withstandards before C99 [-Wdeclaration-after-statement]". Moving the declaration of 'result' to the beginning like
belowcan resolve the warning, and it would be better to use a unique variable instead of 'result'. 
 

#ifdef __darwin__
static char extra_envvars[4096];
+int result = -1;
... ...
-int result = snprintf(extra_envvars, sizeof(extra_envvars), "DYLD_LIBRARY_PATH=%s",
+result = snprintf(extra_envvars, sizeof(extra_envvars), "DYLD_LIBRARY_PATH=%s",

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [PATCH] Missing dep on Catalog.pm in meson rules
Next
From: Jeff Davis
Date:
Subject: Re: [17] collation provider "builtin"