summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2021-12-12 19:54:37 +0000
committerTom Lane2021-12-12 19:54:37 +0000
commitfed9cf2cb9ef4cdc3fe8b09dc2eb19e82fe1cc8b (patch)
tree762203816027cc7359bbf66c6bc4195df795ad77
parent8786f783ab2398468a8c4d8eac937fc6533d16e3 (diff)
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 1c0cf52b3 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/[email protected]
-rw-r--r--config/c-compiler.m44
-rw-r--r--config/c-library.m44
-rwxr-xr-xconfigure12
3 files changed, 15 insertions, 5 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4
index 8a216c9f73c..349e0932a9f 100644
--- a/config/c-compiler.m4
+++ b/config/c-compiler.m4
@@ -84,8 +84,10 @@ int does_int64_work()
return 0;
return 1;
}
+
+int
main() {
- exit(! does_int64_work());
+ return (! does_int64_work());
}],
[Ac_cachevar=yes],
[Ac_cachevar=no],
diff --git a/config/c-library.m4 b/config/c-library.m4
index 70eb0e4dcf7..d1849214645 100644
--- a/config/c-library.m4
+++ b/config/c-library.m4
@@ -250,8 +250,10 @@ int does_int64_snprintf_work()
return 0; /* either multiply or snprintf is busted */
return 1;
}
+
+int
main() {
- exit(! does_int64_snprintf_work());
+ return (! does_int64_snprintf_work());
}],
[pgac_cv_snprintf_long_long_int_format=$pgac_format; break],
[],
diff --git a/configure b/configure
index 6c2a1755ce7..23486236442 100755
--- a/configure
+++ b/configure
@@ -24588,8 +24588,10 @@ int does_int64_work()
return 0;
return 1;
}
+
+int
main() {
- exit(! does_int64_work());
+ return (! does_int64_work());
}
_ACEOF
rm -f conftest$ac_exeext
@@ -24725,8 +24727,10 @@ int does_int64_work()
return 0;
return 1;
}
+
+int
main() {
- exit(! does_int64_work());
+ return (! does_int64_work());
}
_ACEOF
rm -f conftest$ac_exeext
@@ -24829,8 +24833,10 @@ int does_int64_snprintf_work()
return 0; /* either multiply or snprintf is busted */
return 1;
}
+
+int
main() {
- exit(! does_int64_snprintf_work());
+ return (! does_int64_snprintf_work());
}
_ACEOF
rm -f conftest$ac_exeext