On Mon, Jul 11, 2016 at 4:34 PM, Jakub Jelinek <ja...@redhat.com> wrote: > On Mon, Jul 11, 2016 at 10:23:30PM +0200, Marek Polacek wrote: >> On Mon, Jul 11, 2016 at 01:18:02PM -0700, Andi Kleen wrote: >> > > I explained why supporting the classic lint style comment wouldn't fly. >> > >> > Not convincing, it worked fine for 30+ years of lints. >> >> So how can the compiler handle >> /* Never ever fall through here */ >> ? > > It can't. But it perhaps could handle a couple of documented most common > comment styles, perhaps only if followed by break token, and turn say > /* FALLTHROUGH */ > break > (and say: > /* FALL THROUGH */ > /* FALLTHRU */ > /* FALL THRU */ > /*-fallthrough*/ > /* Fallthrough */ > /* Fall through */ > /* Fallthru */ > /* Fall thru */ > /* fallthrough */ > /* fall through */ > /* fallthru */ > /* fall thru */ > // FALLTHROUGH > // FALL THROUGH > // FALLTHRU > // FALL THRU > //-fallthrough > // Fallthrough > // Fall through > // Fallthru > // Fall thru > // fallthrough > // fall through > // fallthru > // fall thru
>From http://security.coverity.com/blog/2013/Sep/gimme-a-break.html: We also suppress a case label if there is a comment that matches [^#]fall.?thro?u, even if it's not on the last line. Maybe that's enough? The page has other exclusions that might be desirable.