Skip to content

Commit f24374b

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 c10bb23 commit f24374b

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
@@ -251,8 +251,10 @@ int does_int64_snprintf_work()
251251
return 0; /* either multiply or snprintf is busted */
252252
return 1;
253253
}
254+
255+
int
254256
main() {
255-
exit(! does_int64_snprintf_work());
257+
return (! does_int64_snprintf_work());
256258
}],
257259
[pgac_cv_snprintf_long_long_int_format=$pgac_format; break],
258260
[],

configure

+9-3
Original file line numberDiff line numberDiff line change
@@ -25530,8 +25530,10 @@ int does_int64_work()
2553025530
return 0;
2553125531
return 1;
2553225532
}
25533+
25534+
int
2553325535
main() {
25534-
exit(! does_int64_work());
25536+
return (! does_int64_work());
2553525537
}
2553625538
_ACEOF
2553725539
rm -f conftest$ac_exeext
@@ -25669,8 +25671,10 @@ int does_int64_work()
2566925671
return 0;
2567025672
return 1;
2567125673
}
25674+
25675+
int
2567225676
main() {
25673-
exit(! does_int64_work());
25677+
return (! does_int64_work());
2567425678
}
2567525679
_ACEOF
2567625680
rm -f conftest$ac_exeext
@@ -25780,8 +25784,10 @@ int does_int64_snprintf_work()
2578025784
return 0; /* either multiply or snprintf is busted */
2578125785
return 1;
2578225786
}
25787+
25788+
int
2578325789
main() {
25784-
exit(! does_int64_snprintf_work());
25790+
return (! does_int64_snprintf_work());
2578525791
}
2578625792
_ACEOF
2578725793
rm -f conftest$ac_exeext

0 commit comments

Comments
 (0)