[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 03:03:33 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           |     Resolution:
 Keywords:  clang scan-build  |  Actual Points:
Parent ID:                    |         Points:  0.1
 Reviewer:                    |        Sponsor:
------------------------------+----------------------------------
Description changed by teor:

Old description:

> 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.

New description:

 This is fine, we can rewrite it, or tell scan-build to ignore it:
 dirvote_get_intermediate_param_value:
 {{{
 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#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list