diff options
author | Joe Perches <joe@perches.com> | 2019-10-05 18:46:43 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-10-11 18:26:05 +0200 |
commit | b9918bdcac1ff7bf11f1ab64708267c73f9b2552 (patch) | |
tree | 67f917f9d59b034053a9521d9c02881e87200d98 /Documentation/process/coding-style.rst | |
parent | compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use (diff) | |
download | linux-b9918bdcac1ff7bf11f1ab64708267c73f9b2552.tar.xz linux-b9918bdcac1ff7bf11f1ab64708267c73f9b2552.zip |
Documentation/process: Add fallthrough pseudo-keyword
Describe the fallthrough pseudo-keyword.
Convert the coding-style.rst example to the keyword style.
Add description and links to deprecated.rst.
Miguel Ojeda comments on the eventual [[fallthrough]] syntax:
"Note that C17/C18 does not have [[fallthrough]].
C++17 introduced it, as it is mentioned above. I would keep the
__attribute__((fallthrough)) -> [[fallthrough]] change you did,
though, since that is indeed the standard syntax (given the paragraph
references C++17).
I was told by Aaron Ballman (who is proposing them for C) that it is
more or less likely that it becomes standardized in C2x. However, it
is still not added to the draft (other attributes are already,
though). See N2268 and N2269:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2268.pdf (fallthrough)
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2269.pdf (attributes in general)"
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/process/coding-style.rst')
-rw-r--r-- | Documentation/process/coding-style.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst index f4a2198187f9..ada573b7d703 100644 --- a/Documentation/process/coding-style.rst +++ b/Documentation/process/coding-style.rst @@ -56,7 +56,7 @@ instead of ``double-indenting`` the ``case`` labels. E.g.: case 'K': case 'k': mem <<= 10; - /* fall through */ + fallthrough; default: break; } |