aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-10-07 20:57:55 +0200
committerGitHub <noreply@github.com>2023-10-07 20:57:55 +0200
commit506d119c16135b3bb352c2dad1c902646c18de75 (patch)
tree96b83b21b1e67afcbddbf648a020384ab2c650e6
parent753adcc66cb2210e292e67500142f3d9f1b45543 (diff)
parent380870335f27ffeba1cd539f4f6f4559f1c2932c (diff)
downloadrneovim-506d119c16135b3bb352c2dad1c902646c18de75.tar.gz
rneovim-506d119c16135b3bb352c2dad1c902646c18de75.tar.bz2
rneovim-506d119c16135b3bb352c2dad1c902646c18de75.zip
Merge pull request #25533 from famiu/docs/style/abort-default
docs: use `abort()` for unreachable `default:` case in C
-rw-r--r--runtime/doc/dev_style.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/doc/dev_style.txt b/runtime/doc/dev_style.txt
index b96b01dbff..79e758a11e 100644
--- a/runtime/doc/dev_style.txt
+++ b/runtime/doc/dev_style.txt
@@ -846,7 +846,7 @@ Annotate non-trivial fall-through between cases.
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
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) {
case 0:
@@ -856,7 +856,7 @@ execute, simply `assert`: >c
...
break;
default:
- assert(false);
+ abort();
}
Return Values ~