bug-gnulib
[Top][All Lists]
Advanced

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

Re: MSVC fails to compile floor.c with -fp:strict


From: Bruno Haible
Subject: Re: MSVC fails to compile floor.c with -fp:strict
Date: Thu, 23 Feb 2012 11:12:06 +0100
User-agent: KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; )

Michael Goffioul wrote:
> I encountered a compilation error with MSVC when compiling floor.c in
> strict floating-point mode (-fp:strict). The error is:
> 
> "error C2099: initializer is not a constant"
> 
> The error is triggered by the initializer for the constant variable
> TWO_MANT_DIG and is documented here:
> 
> http://msdn.microsoft.com/en-us/library/t801az8a(v=vs.80).aspx

Does adding the line
  #pragma fenv_access (off)
before the initialization help?

*** lib/floor.c.orig    Thu Feb 23 11:11:48 2012
--- lib/floor.c Thu Feb 23 11:11:43 2012
***************
*** 42,47 ****
--- 42,51 ----
  # define L_(literal) literal##f
  #endif
  
+ #ifdef _MSC_VER
+ # pragma fenv_access (off)
+ #endif
+ 
  /* 2^(MANT_DIG-1).  */
  static const DOUBLE TWO_MANT_DIG =
    /* Assume MANT_DIG <= 5 * 31.




reply via email to

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