[tor-bugs] #26283 [Core Tor/Tor]: smartlist_len cast to double

Tor Bug Tracker & Wiki blackhole at torproject.org
Sun Jun 3 12:25:25 UTC 2018


#26283: smartlist_len cast to double
------------------------------+--------------------------------
     Reporter:  rl1987        |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.3.5.x-final
    Component:  Core Tor/Tor  |    Version:  Tor: unspecified
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:  #26196
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------
 When building with `DEBUG_SMARTLIST`:

 {{{
 src/or/routerlist.c:2767:45: warning: cast from function call of type
 'int' to non-matching type 'double' [-Wbad-function-cast]
     return ((double)n_with_descs) / (double)smartlist_len(sl);
                                             ^~~~~~~~~~~~~~~~~
 1 warning generated.
 }}}

 {{{
 src/or/routerlist.c:2767:45: warning: cast from function call of type
 'int' to non-matching type 'double' [-Wbad-function-cast]
     return ((double)n_with_descs) / (double)smartlist_len(sl);
                                             ^~~~~~~~~~~~~~~~~
 1 warning generated.
 }}}

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


More information about the tor-bugs mailing list