On 26 September 2023 18:46:11 CEST, Tobias Burnus <tob...@codesourcery.com> wrote: >On 26.09.23 18:37, Andrew Stubbs wrote: >> If the fall-through is deliberate please add a /* FALLTHROUGH */ >> comment (or whatever spelling disables the warning). > >It's: gcc_fallthrough (); > >Which gets converted to "__attribute__((fallthrough))"; it could also >expand to "[[fallthrough]]" but that's C++17 (and, also, an C23 feature >- albeit so far unimplemented in gcc).
OT IIRC we do parse comments for a number of spellings of the hint by the user that the fallthrough is deliberate: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html See the numerous levels of -Wimplicit-fallthrough=n, the default being 3. ---8<--- -Wimplicit-fallthrough=3 case sensitively matches one of the following regular expressions: -fallthrough @fallthrough@ lint -fallthrough[ \t]* [ \t.!]*(ELSE,? |INTENTIONAL(LY)? )? FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)? [ \t.!]*(Else,? |Intentional(ly)? )? Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)? [ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )? fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)? ---8<--- Just FWIW. thanks,