]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Use return instead of exit() in configure
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 8 Sep 2020 08:09:43 +0000 (10:09 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 8 Sep 2020 08:09:43 +0000 (10:09 +0200)
Using exit() requires stdlib.h, which is not included.  Use return
instead.  Also add return type for main().

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Thomas Munro <thomas.munro@enterprisedb.com>
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 <thomas.gilligan@icloud.com>
Reported-by: Jesse Zhang <sbjesse@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/09A4B554-82B1-4536-B191-2461342EE0BB%40icloud.com

config/c-compiler.m4
config/c-library.m4
configure

index f87beb0d66d0d09901d526457b759c259d464f16..8bc6d32e23282f79517db2993a3c59785450af82 100644 (file)
@@ -71,8 +71,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],
index 82b161417a114ba20270c91aba3c53e42fa751e0..a893d68e02eb456b54585153cb4a28b29ade8260 100644 (file)
@@ -204,8 +204,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],
 [],
index d4442f38286b1dfa47e0779c8c882dee73bf62fa..394f658e35eef16203ead0b6c8a3f6c6ebec85eb 100755 (executable)
--- a/configure
+++ b/configure
@@ -13853,8 +13853,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 :
@@ -13935,8 +13937,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 :
@@ -14011,8 +14015,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 :