[tor-bugs] #21495 [Core Tor/Tor]: Fix scan-build warning: true and false branches are identical

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Feb 18 02:45:23 UTC 2017


#21495: Fix scan-build warning: true and false branches are identical
------------------------------+------------------------------
     Reporter:  teor          |      Owner:
         Type:  defect        |     Status:  new
     Priority:  Very Low      |  Milestone:  Tor: unspecified
    Component:  Core Tor/Tor  |    Version:
     Severity:  Trivial       |   Keywords:  clang scan-build
Actual Points:                |  Parent ID:
       Points:  0.1           |   Reviewer:
      Sponsor:                |
------------------------------+------------------------------
 This is fine, we can rewrite it, or tell scan-build to ignore it:
 {{{
 else if (BUG(n_found > 1))
   return default_val;
 else
   return default_val;
 }}}

 I blame boolean macros with side-effects.

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


More information about the tor-bugs mailing list