lkml.org 
[lkml]   [2018]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] Compiler Attributes: add support for __fallthrough (gcc >= 7.1)
From
Date
Hi all!

On 22/10/18 19:54, Nick Desaulniers wrote:
> On Mon, Oct 22, 2018 at 10:50 AM Bernd Petrovitsch
> <bernd@petrovitsch.priv.at> wrote:
[...]
>> PS: clang++ errors with "fallthrough annotation in unreachable code" if
>> [[fallthrough]] is after an assert(). clang-devs there, please, the
>> fallthrough doesn't really generated code (I hope;-).
[...]
> Can you send me a link to a simple reproducer in godbolt (godbolt.org)
> and we'll take a look?

Does https://godbolt.org/z/2Y4zIo do it - I'm a godbolt-newbie?

For
---- snip ----
#include <cassert>

int main(void)
{
switch (1) {
default:
assert(0);
[[fallthrough]];
case 1:
;
}
return 0;
}
---- snip ----
Just "clang++ -Wimplicit-fallthrough -Werror" it .....

MfG,
Bernd
--
"I dislike type abstraction if it has no real reason. And saving
on typing is not a good reason - if your typing speed is the main
issue when you're coding, you're doing something seriously wrong."
- Linus Torvalds
[unhandled content-type:application/pgp-keys]
\
 
 \ /
  Last update: 2018-10-22 20:17    [W:0.145 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site