Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Use return instead of exit() in configure
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 8 Sep 2020 08:09:56 +0000 (10:09 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 8 Sep 2020 08:09:56 +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 a810cf33295d3f3922a1c8a7c76d3afe8be0f322..8ce0621a65a91ab3c2368f46cb4480c0d95c96bd 100644 (file)
@@ -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],
index 1848d28b740ec1eeee1ded923c48aa65bd61ed92..5d0894e9746953ef26aeb095b00f07017c253359 100644 (file)
@@ -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],
 [],
index 85b01dde3fc162528902669d2017618729367f24..2d0296290b8cf7715345f3aa0fc2e6e92f7547b6 100755 (executable)
--- 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 :