Prevent switch/case statement "fall through" warnings [trivial]#1163
Merged
whitwham merged 1 commit intosamtools:developfrom Nov 9, 2020
Merged
Prevent switch/case statement "fall through" warnings [trivial]#1163whitwham merged 1 commit intosamtools:developfrom
whitwham merged 1 commit intosamtools:developfrom
Conversation
Add comments indicating intentional fall-throughs. Adjust comment in textutils_internal.h to match GCC's -Wimplicit-fallthrough[=3] pattern. Annotate several functions that call exit() as HTS_NORETURN so the compiler knows they won't actually fall through in any switch statements they appear in. (Clang understands only not-yet-standard attributes and annotations, not comment text, so there's little point in catering to its -Wimplicit- fallthrough warning, which isn't included in -Wall/-Wextra in Clang.)
Member
Author
|
Thanks Andrew. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[A trivial one that's been in a holding pattern since before the 1.11 release…]
Add comments indicating intentional fall-throughs, so that
gcc -Wextrabuilds don't need-Wno-implicit-fallthroughas well.(Clang understands only not-yet-standard attributes and annotations, not comment text, so there's little point in catering to its
-Wimplicit-fallthroughwarning, which isn't included in‑Wall/‑Wextrain Clang.)