From e9d1506f6bc19cbde441f9e9f2d7869b7fc49d87 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 15 Aug 2020 17:23:02 +0200 Subject: [PATCH] frexpl: Fix configuration test result on MSVC. * m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Avoid a division by a constant zero. --- ChangeLog | 6 ++++++ m4/frexpl.m4 | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b08d6f76e..65bdf1cde0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2020-08-15 Bruno Haible + + frexpl: Fix configuration test result on MSVC. + * m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Avoid a division by a constant + zero. + 2020-08-15 Bruno Haible Support compiling without -loldnames on native Windows. diff --git a/m4/frexpl.m4 b/m4/frexpl.m4 index e79fa5cbd9..d5951c4310 100644 --- a/m4/frexpl.m4 +++ b/m4/frexpl.m4 @@ -1,4 +1,4 @@ -# frexpl.m4 serial 21 +# frexpl.m4 serial 22 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -150,6 +150,7 @@ extern "C" #endif long double frexpl (long double, int *); +long double zero = 0.0L; int main() { int result = 0; @@ -207,7 +208,8 @@ int main() } } /* Test on infinite numbers. */ - x = 1.0L / 0.0L; + /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */ + x = 1.0L / zero; { int exp; long double y = frexpl (x, &exp); -- 2.39.5