[tor-bugs] #22915 [- Select a component]: clang 4.0 double promotion warnings in clamp_double_to_int64()

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Jul 13 21:33:19 UTC 2017


#22915: clang 4.0 double promotion warnings in clamp_double_to_int64()
-------------------------------------+-------------------------------------
     Reporter:  nickm                |      Owner:
         Type:  defect               |     Status:  new
     Priority:  Medium               |  Milestone:  Tor: 0.3.2.x-final
    Component:  - Select a           |    Version:
  component                          |   Keywords:  029-backport
     Severity:  Normal               |  030-backport 031-backport
Actual Points:                       |  Parent ID:
       Points:                       |   Reviewer:
      Sponsor:                       |
-------------------------------------+-------------------------------------
 Just upgraded to clang 4.0, and I'm seeing this:

 {{{
   CC       src/common/util.o
 src/common/util.c:5612:13: error: implicit conversion increases floating-
 point
       precision: 'double' to 'long double' [-Werror,-Wdouble-promotion]
   if (isnan(number)) {
       ~~~~~~^~~~~~~
 /usr/include/math.h:385:46: note: expanded from macro 'isnan'
 #  define isnan(x) __MATH_TG ((x), __isnan, (x))
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
 /usr/include/math.h:320:16: note: expanded from macro '__MATH_TG'
    : FUNC ## l ARGS)
      ~~~~~~~~~ ^~~~
 src/common/util.c:5630:16: error: implicit conversion increases floating-
 point
       precision: 'double' to 'long double' [-Werror,-Wdouble-promotion]
   if (isfinite(number) && exponent <= 63) {
       ~~~~~~~~~^~~~~~~
 /usr/include/math.h:370:50: note: expanded from macro 'isfinite'
 #  define isfinite(x) __MATH_TG ((x), __finite, (x))
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
 /usr/include/math.h:320:16: note: expanded from macro '__MATH_TG'
    : FUNC ## l ARGS)
      ~~~~~~~~~ ^~~~
 src/common/util.c:5635:18: error: implicit conversion increases floating-
 point
       precision: 'double' to 'long double' [-Werror,-Wdouble-promotion]
   return signbit(number) ? INT64_MIN : INT64_MAX;
          ~~~~~~~~^~~~~~~
 /usr/include/math.h:361:58: note: expanded from macro 'signbit'
 #  define signbit(x) __MATH_TG ((x), __builtin_signbit, (x))
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
 /usr/include/math.h:320:16: note: expanded from macro '__MATH_TG'
    : FUNC ## l ARGS)
      ~~~~~~~~~ ^~~~
 3 errors generated.
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22915>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list