[tor-bugs] #32579 [Core Tor/Tor]: Use clang's -Wimplicit-fallthrough and fallthrough attribute on case statements

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Nov 27 03:00:54 UTC 2019


#32579: Use clang's -Wimplicit-fallthrough and fallthrough attribute on case
statements
------------------------------+----------------------------------
 Reporter:  teor              |          Owner:  (none)
     Type:  enhancement       |         Status:  reopened
 Priority:  Medium            |      Milestone:  Tor: unspecified
Component:  Core Tor/Tor      |        Version:
 Severity:  Normal            |     Resolution:
 Keywords:  code-correctness  |  Actual Points:
Parent ID:                    |         Points:  1
 Reviewer:                    |        Sponsor:
------------------------------+----------------------------------
Changes (by teor):

 * status:  closed => reopened
 * resolution:  worksforme =>


Comment:

 If we are doing it, we're doing it wrong, here's a fallthrough that should
 require the fallthrough attribute:
 {{{
 src/core/proto/proto_socks.c-      case SOCKS_RESULT_TRUNCATED:
 src/core/proto/proto_socks.c-        if (datalen == n_pullup)
 src/core/proto/proto_socks.c-          return 0;
 src/core/proto/proto_socks.c-        /* FALLTHRU */
 src/core/proto/proto_socks.c-      case SOCKS_RESULT_MORE_EXPECTED:
 src/core/proto/proto_socks.c-        res = 0;
 src/core/proto/proto_socks.c-        break;
 }}}

 I don't think comments count, and even if they do, I can't imagine this
 spelling being supported :-)

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


More information about the tor-bugs mailing list