aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorFamiu Haque <famiuhaque@proton.me>2023-10-07 20:34:33 +0600
committerFamiu Haque <famiuhaque@proton.me>2023-10-07 20:47:55 +0600
commit380870335f27ffeba1cd539f4f6f4559f1c2932c (patch)
treea20fbab2b52a46e43d18118e086f36ff10abc93e /runtime/lua/vim/lsp/util.lua
parent1f864139b2d7e3fcb73fb0b7f5291fbb1c6cad94 (diff)
downloadrneovim-380870335f27ffeba1cd539f4f6f4559f1c2932c.tar.gz
rneovim-380870335f27ffeba1cd539f4f6f4559f1c2932c.tar.bz2
rneovim-380870335f27ffeba1cd539f4f6f4559f1c2932c.zip
docs: use `abort()` for unreachable `default:` case in C
Problem: The style guide currently recommends having a `default:` case for switch statements that are not conditional on an enumerated value. Additionally, it recommends using `assert(false)` if `default:` is unreachable. This is problematic because `assert()` only runs on debug builds, which may lead to confusing breakages in release builds. Moreover, this suggestion is followed nowhere in the C code and `abort()` is used everywhere instead. Solution: Suggest using `abort()` instead of `assert(false)`, that way the program always terminates if a logically unreachable case is reached.
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
0 files changed, 0 insertions, 0 deletions