From: Bruno Haible Date: Tue, 11 Jul 2017 01:52:48 +0000 (+0200) Subject: round, roundf: Avoid compiler warning in configure test. X-Git-Tag: v1.0~6070 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=f12a7bbb4acaaa72f48e452e04da2a4dd749a664;p=gnulib.git round, roundf: Avoid compiler warning in configure test. * m4/round.m4 (gl_FUNC_ROUND): Use 'return' instead of exit(). * m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise. --- diff --git a/ChangeLog b/ChangeLog index c05a5e481b..4fcc254b4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-07-10 Bruno Haible + + round, roundf: Avoid compiler warning in configure test. + * m4/round.m4 (gl_FUNC_ROUND): Use 'return' instead of exit(). + * m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise. + 2017-07-10 Bruno Haible getlogin tests: Avoid #ifdefs when sharing code between modules. diff --git a/m4/round.m4 b/m4/round.m4 index 45b7df4591..ede34b29d6 100644 --- a/m4/round.m4 +++ b/m4/round.m4 @@ -1,4 +1,4 @@ -# round.m4 serial 16 +# round.m4 serial 17 dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -57,7 +57,7 @@ int main() * (double) (1U << ((DBL_MANT_DIG + 3) / 5)) * (double) (1U << ((DBL_MANT_DIG + 4) / 5)); volatile double x = 0.5 - 0.5 / TWO_MANT_DIG; - exit (x < 0.5 && round (x) != 0.0); + return (x < 0.5 && round (x) != 0.0); }]])], [gl_cv_func_round_works=yes], [gl_cv_func_round_works=no], [case "$host_os" in netbsd* | aix*) gl_cv_func_round_works="guessing no";; diff --git a/m4/roundf.m4 b/m4/roundf.m4 index 543ee0f934..f623b554a7 100644 --- a/m4/roundf.m4 +++ b/m4/roundf.m4 @@ -1,4 +1,4 @@ -# roundf.m4 serial 17 +# roundf.m4 serial 18 dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -54,7 +54,7 @@ int main() * (float) (1U << ((FLT_MANT_DIG + 1) / 3)) * (float) (1U << ((FLT_MANT_DIG + 2) / 3)); volatile float x = 0.5f - 0.5f / TWO_MANT_DIG; - exit (x < 0.5f && roundf (x) != 0.0f); + return (x < 0.5f && roundf (x) != 0.0f); }]])], [gl_cv_func_roundf_works=yes], [gl_cv_func_roundf_works=no], [case "$host_os" in mingw*) gl_cv_func_roundf_works="guessing no";;