bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

frexpl: Fix configuration test result on MSVC


From: Bruno Haible
Subject: frexpl: Fix configuration test result on MSVC
Date: Sat, 15 Aug 2020 17:23:57 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-186-generic; KDE/5.18.0; x86_64; ; )

The MSVC compiler does not like to compile the autoconf test for frexpl:
  error C2124: divide or mod by zero


2020-08-15  Bruno Haible  <bruno@clisp.org>

        frexpl: Fix configuration test result on MSVC.
        * m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Avoid a division by a constant
        zero.

diff --git a/m4/frexpl.m4 b/m4/frexpl.m4
index e79fa5c..d5951c4 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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]