mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
Merge pull request #25533 from famiu/docs/style/abort-default
docs: use `abort()` for unreachable `default:` case in C
This commit is contained in:
commit
506d119c16
@ -846,7 +846,7 @@ Annotate non-trivial fall-through between cases.
|
|||||||
If not conditional on an enumerated value, switch statements should always
|
If not conditional on an enumerated value, switch statements should always
|
||||||
have a `default` case (in the case of an enumerated value, the compiler will
|
have a `default` case (in the case of an enumerated value, the compiler will
|
||||||
warn you if any values are not handled). If the default case should never
|
warn you if any values are not handled). If the default case should never
|
||||||
execute, simply `assert`: >c
|
execute, simply use `abort()`: >c
|
||||||
|
|
||||||
switch (var) {
|
switch (var) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -856,7 +856,7 @@ execute, simply `assert`: >c
|
|||||||
...
|
...
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(false);
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
Return Values ~
|
Return Values ~
|
||||||
|
Loading…
Reference in New Issue
Block a user