[Varnish] #931: compile failure on isfinite(int)

Varnish varnish-bugs at varnish-cache.org
Fri Jun 3 17:45:44 CEST 2011


#931: compile failure on isfinite(int)
-----------------------------+----------------------------------------------
 Reporter:  geoff            |        Type:  defect
   Status:  new              |    Priority:  normal
Milestone:  Varnish 3.0 dev  |   Component:  build 
  Version:  trunk            |    Severity:  normal
 Keywords:                   |  
-----------------------------+----------------------------------------------
 Building from trunk:

 {{{
 commit a39be7ab6a44ee0ecc5bf512a8a4b654ae5ca5ff
 Date:   Thu Jun 2 22:59:43 2011 +0000
 }}}


 I get the following error:


 {{{
 vmod_std_conversions.c: In function 'vmod_integer':
 vmod_std_conversions.c:112:2: error: non-floating-point argument in call
 to function '__builtin_isnan'
 vmod_std_conversions.c:112:2: error: non-floating-point argument in call
 to function '__builtin_isinf'
 }}}


 Built on OpenSolaris using gcc 4.5.1:


 {{{
 $ uname -a
 SunOS gsimmons 5.11 snv_134 i86pc i386 i86pc Solaris

 $ gcc --version
 gcc (Blastwave.org Inc. Mon Aug 23 11:16:32 GMT 2010) 4.5.1
 }}}

 I didn't get the error building on Debian 5.0.5.

 Line 112 in vmod_std_conversions.c includes the macro isfinite(r) for an
 int r, and my setup apparently won't allow the int. isfinite() expands in
 /usr/include/iso/math_c99.h to use the "builtin" calls shown above, and
 they evidently require a floating point type. (The macro expansion is
 different for gcc < 4, but that one also calls a "builtin" function which
 requires a floating point type, so the compile fails for the same reason.)

 The workaround is simple, just cast r to double. The compile succeeds with
 isfinite((double) r).

-- 
Ticket URL: <http://www.varnish-cache.org/trac/ticket/931>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list