[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs