diff options
author | Joe Perches <[email protected]> | 2019-10-05 09:46:42 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2019-10-11 09:26:05 -0700 |
commit | 294f69e662d1570703e9b56e95be37a9fd3afba5 (patch) | |
tree | 8138e829d29b3f06e3bc1de49cab4a34e31dc1a7 /scripts/mod/modpost.c | |
parent | 48f9bcf91461b43249949f4e172b5c0245dde751 (diff) |
compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use
Reserve the pseudo keyword 'fallthrough' for the ability to convert the
various case block /* fallthrough */ style comments to appear to be an
actual reserved word with the same gcc case block missing fallthrough
warning capability.
All switch/case blocks now should end in one of:
break;
fallthrough;
goto <label>;
return [expression];
continue;
In C mode, GCC supports the __fallthrough__ attribute since 7.1,
the same time the warning and the comment parsing were introduced.
fallthrough devolves to an empty "do {} while (0)" if the compiler
version (any version less than gcc 7) does not support the attribute.
Signed-off-by: Joe Perches <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Suggested-by: Dan Carpenter <[email protected]>
Cc: Miguel Ojeda <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'scripts/mod/modpost.c')
0 files changed, 0 insertions, 0 deletions