summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2020-09-08 08:09:56 +0000
committerPeter Eisentraut2020-09-08 08:09:56 +0000
commit69fdf3d2e987cb5543f00a945cffbf6e422d5868 (patch)
tree1576303fc4541adb262a657fdb98fcd1348387aa
parente0b4c7dd0b61461da8e4a74a98326e4b591fd575 (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(). Reviewed-by: Heikki Linnakangas <[email protected]> Reviewed-by: Thomas Munro <[email protected]> Backpatched because Apple macOS 10.16/11 (Big Sur) compiler makes calling undeclared functions an error, so these configure tests would fail. Reported-by: Thomas Gilligan <[email protected]> Reported-by: Jesse Zhang <[email protected]> Reviewed-by: Tom Lane <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/09A4B554-82B1-4536-B191-2461342EE0BB%40icloud.com
-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 a810cf33295..8ce0621a65a 100644
--- a/config/c-compiler.m4
+++ b/config/c-compiler.m4
@@ -105,8 +105,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 1848d28b740..5d0894e9746 100644
--- a/config/c-library.m4
+++ b/config/c-library.m4
@@ -231,8 +231,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_modifier=$pgac_modifier; break],
[],
diff --git a/configure b/configure
index 85b01dde3fc..2d0296290b8 100755
--- a/configure
+++ b/configure
@@ -13805,8 +13805,10 @@ int does_int64_work()
return 0;
return 1;
}
+
+int
main() {
- exit(! does_int64_work());
+ return (! does_int64_work());
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
@@ -13887,8 +13889,10 @@ int does_int64_work()
return 0;
return 1;
}
+
+int
main() {
- exit(! does_int64_work());
+ return (! does_int64_work());
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
@@ -13963,8 +13967,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
if ac_fn_c_try_run "$LINENO"; then :