Skip to content

Commit fed9cf2

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 8786f78 commit fed9cf2

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

config/c-compiler.m4

Lines changed: 3 additions & 1 deletion
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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,10 @@ int does_int64_snprintf_work()
250250
return 0; /* either multiply or snprintf is busted */
251251
return 1;
252252
}
253+
254+
int
253255
main() {
254-
exit(! does_int64_snprintf_work());
256+
return (! does_int64_snprintf_work());
255257
}],
256258
[pgac_cv_snprintf_long_long_int_format=$pgac_format; break],
257259
[],

configure

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24588,8 +24588,10 @@ int does_int64_work()
2458824588
return 0;
2458924589
return 1;
2459024590
}
24591+
24592+
int
2459124593
main() {
24592-
exit(! does_int64_work());
24594+
return (! does_int64_work());
2459324595
}
2459424596
_ACEOF
2459524597
rm -f conftest$ac_exeext
@@ -24725,8 +24727,10 @@ int does_int64_work()
2472524727
return 0;
2472624728
return 1;
2472724729
}
24730+
24731+
int
2472824732
main() {
24729-
exit(! does_int64_work());
24733+
return (! does_int64_work());
2473024734
}
2473124735
_ACEOF
2473224736
rm -f conftest$ac_exeext
@@ -24829,8 +24833,10 @@ int does_int64_snprintf_work()
2482924833
return 0; /* either multiply or snprintf is busted */
2483024834
return 1;
2483124835
}
24836+
24837+
int
2483224838
main() {
24833-
exit(! does_int64_snprintf_work());
24839+
return (! does_int64_snprintf_work());
2483424840
}
2483524841
_ACEOF
2483624842
rm -f conftest$ac_exeext

0 commit comments

Comments
 (0)