Closed dangelog closed 3 years ago
Let me declare clearly I have no intention to invest my time in silencing a warning in one particular compiler which I consider silly (really, what if my comments are in Swahili?), which is not enabled by default nor with -Wall
and which does not really make the code better.
But feel free to make a PR, if it does not make things worse, I could merge it. That's more or less the maximum I am willing to do about it.
(And see also discussion in #34 and PR #35.)
Fixed by merging #141
There are few switch statements in the code where the fallthrough between case labels causes warning. This is from a build of Qt:
These statements are already annotated in the code with a comment (that is, these fall throughs are INTENDED).
The problem is that GCC doesn't recognize the comment as-is.
-Wimplicit-fallthrough
only recognizes "Fall through" and some variations, and not "Pass". See https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthroughSuggestion: either rename "Pass through" in "Fall through", or define a
MD_FALLTHROUGH
macro, and make it expand to__attribute__((fallthrough))
on GCC >= 7, and also to whatever appeases other compilers (I think only Clang 12 also supports the attribute syntax; Clang in general won't recognize the comment).