postgres.git / summary / log / commit / refs

commit    27acbd51e60c98cba6441d7a88210a1c33bf9db4
Author:   Peter Eisentraut <peter@eisentraut.org>
Date:     Tue Sep 08 08:09:43 2020 +0000
First released in: 9.5.24, 9.6.20

    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 <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 | 4 +++- config/c-library.m4 | 4 +++- configure | 12 +++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/config/c-compiler.m4 b/config/c-compiler.m4 index f87beb0d66d..8bc6d32e232 100644 --- a/config/c-compiler.m4 +++ b/config/c-compiler.m4 @@ -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], diff --git a/config/c-library.m4 b/config/c-library.m4 index 82b161417a1..a893d68e02e 100644 --- a/config/c-library.m4 +++ b/config/c-library.m4 @@ -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], [], diff --git a/configure b/configure index d4442f38286..394f658e35e 100755 --- 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 : [parent: 2939f613fa91]