[tor-bugs] #31343 [Core Tor/Tor]: appveyor: labs(time_t) is not allowed

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Aug 5 22:08:26 UTC 2019


#31343: appveyor: labs(time_t) is not allowed
------------------------------+--------------------------------
     Reporter:  nickm         |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.4.2.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:  backports?
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------
 Mike points out that appveyor is failing with

 {{{
 ../src/core/or/channeltls.c:1768:7: error: absolute value function 'labs'
 given an argument of type 'time_t' {aka 'long long int'} but has parameter
 of type 'long int' which may cause truncation of value [-Werror=absolute-
 value]
  1768 |   if (labs(now - chan->conn->handshake_state->sent_versions_at) <
 180) {
       |       ^~~~
 }}}

 That code has been there for ages, though.  Looks like this is a new
 compiler warning rather than a new bug.  It is a c issue, though, anywhere
 that time_t is bigger than long.

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


More information about the tor-bugs mailing list