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

2019-11-22 Thread Tor Bug Tracker & Wiki
#32579: Use clang's -Wimplicit-fallthrough and fallthrough attribute on case
statements
--+--
 Reporter:  teor  |  Owner:  (none)
 Type:  enhancement   | Status:  new
 Priority:  Medium|  Milestone:  Tor: unspecified
Component:  Core Tor/Tor  |Version:
 Severity:  Normal|   Keywords:  code-correctness
Actual Points:|  Parent ID:
   Points:  1 |   Reviewer:
  Sponsor:|
--+--
 We can avoid accidental fallthroughs using clang's -Wimplicit-fallthrough.

 https://clang.llvm.org/docs/AttributeReference.html#fallthrough

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

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

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

Comment (by teor):

 Here's how we can check for that feature in clang:
 https://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-
 macros

 I think the sa,e syntax works on gcc, but we should check.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

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

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

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


Comment:

 I believe we already enable that -- see configure.ac, and see
 "warning_flags" when building with clang.

 Please reopen if I'm wrong.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

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

2019-11-26 Thread Tor Bug Tracker & Wiki
#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: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

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

2019-11-26 Thread Tor Bug Tracker & Wiki
#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:
--+--

Comment (by teor):

 Here's a working reference:
 
https://releases.llvm.org/9.0.0/tools/clang/docs/AttributeReference.html#fallthrough

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

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

2020-05-01 Thread Tor Bug Tracker & Wiki
#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:  #34078| Points:  1
 Reviewer:|Sponsor:
--+--
Changes (by teor):

 * parent:   => #34078


Comment:

 See also #34078.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

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

2020-05-06 Thread Tor Bug Tracker & Wiki
#32579: Use clang's -Wimplicit-fallthrough and fallthrough attribute on case
statements
--+--
 Reporter:  teor  |  Owner:  (none)
 Type:  enhancement   | Status:  closed
 Priority:  Medium|  Milestone:  Tor: unspecified
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:  fixed
 Keywords:  code-correctness  |  Actual Points:
Parent ID:  #34078| Points:  1
 Reviewer:|Sponsor:
--+--
Changes (by nickm):

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


Comment:

 fixed in parent

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs