[SERVER-55204] Opt in to -Wimplicit-fallthrough in src/mongo Created: 15/Mar/21 Updated: 29/Oct/23 Resolved: 18/Apr/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build, Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 6.1.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Mathias Stearn | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Sprint: | Dev Platform 2022-04-18 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 65 | ||||||||||||||||
| Description |
|
This is a very easy bug to accidentally type, and can be hard to notice in code review. There are only a handful of current violations. I haven't checked if any are bugs, but even if they aren't, it seems like it would be easier for the reader to have an explicit [[fallthrough]] annotation. |
| Comments |
| Comment by Githook User [ 26/May/22 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message:
|
| Comment by Iryna Zhuravlova [ 18/Apr/22 ] |
|
Drew will announce it to the db-contribs |
| Comment by Githook User [ 18/Apr/22 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message: |
| Comment by Githook User [ 18/Apr/22 ] |
|
Author: {'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}Message: |
| Comment by Blake Oler [ 28/Mar/22 ] |
|
This seems like a scons change – if there are any ServiceArch related implicit fallthroughs our team needs to look at, feel free to reach out to the Service Architecture channel. Reassigning to backlog-server-devplatform |
| Comment by Mathias Stearn [ 18/Mar/22 ] |
|
lauren.lewis, what sort of additional information are you looking for? This ticket is suggesting that we enable a compiler flag that can prevent easily overlooked and annoying to debug bugs. Is there some clarification needed? |
| Comment by Lauren Lewis (Inactive) [ 18/Mar/22 ] |
|
We haven’t heard back from you for some time, so we're going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket. |
| Comment by Mathias Stearn [ 15/Mar/21 ] |
|
May want to only do this on GCC since gcc disables the warning if it sees a // fallthrough comment (unfortunately it has to be after closing brace due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81230), while clang will warn unless it sees an actual [[fallthrough]] (or clang-specific equivalent) even if there is a comment. I've only confirmed that there is a manageable amount of warnings (with none in third-party headers) with GCC, so it is possible that it will be still be impractical to use this with clang. |