Skip to content

Commit 47fca01

Browse files
committed
Use return instead of exit() in configure
Using exit() requires stdlib.h, which is not included. Use return instead. Also add return type for main(). This back-patches commit 1c0cf52 into out-of-support branches, pursuant to a newly-established project policy that we'll try to keep out-of-support branches buildable on modern platforms for at least ten major releases back, ensuring people can test pg_dump and psql compatibility against servers that far back. With the current development branch being v15, that works out to keeping 9.2 and up buildable as of today. This fix is needed to get through 'configure' when using recent macOS (and possibly other clang-based toolchains). It seems to be sufficient to get through 'check-world', although there are annoyances such as compiler warnings, which will be dealt with separately. Original patch by Peter Eisentraut Discussion: https://postgr.es/m/d0316012-ece7-7b7e-2d36-9c38cb77cb3b@enterprisedb.com
1 parent 30ffdd2 commit 47fca01

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

config/c-compiler.m4

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ int does_int64_work()
8484
return 0;
8585
return 1;
8686
}
87+
88+
int
8789
main() {
88-
exit(! does_int64_work());
90+
return (! does_int64_work());
8991
}],
9092
[Ac_cachevar=yes],
9193
[Ac_cachevar=no],

config/c-library.m4

+3-1
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,10 @@ int does_int64_snprintf_work()
255255
return 0; /* either multiply or snprintf is busted */
256256
return 1;
257257
}
258+
259+
int
258260
main() {
259-
exit(! does_int64_snprintf_work());
261+
return (! does_int64_snprintf_work());
260262
}],
261263
[pgac_cv_snprintf_long_long_int_format=$pgac_format; break],
262264
[],

configure

+9-3
Original file line numberDiff line numberDiff line change
@@ -13757,8 +13757,10 @@ int does_int64_work()
1375713757
return 0;
1375813758
return 1;
1375913759
}
13760+
13761+
int
1376013762
main() {
13761-
exit(! does_int64_work());
13763+
return (! does_int64_work());
1376213764
}
1376313765
_ACEOF
1376413766
if ac_fn_c_try_run "$LINENO"; then :
@@ -13839,8 +13841,10 @@ int does_int64_work()
1383913841
return 0;
1384013842
return 1;
1384113843
}
13844+
13845+
int
1384213846
main() {
13843-
exit(! does_int64_work());
13847+
return (! does_int64_work());
1384413848
}
1384513849
_ACEOF
1384613850
if ac_fn_c_try_run "$LINENO"; then :
@@ -13915,8 +13919,10 @@ int does_int64_snprintf_work()
1391513919
return 0; /* either multiply or snprintf is busted */
1391613920
return 1;
1391713921
}
13922+
13923+
int
1391813924
main() {
13919-
exit(! does_int64_snprintf_work());
13925+
return (! does_int64_snprintf_work());
1392013926
}
1392113927
_ACEOF
1392213928
if ac_fn_c_try_run "$LINENO"; then :

0 commit comments

Comments
 (0)