diff options
author | Famiu Haque <famiuhaque@proton.me> | 2023-10-10 16:39:06 +0600 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2023-10-10 22:23:54 +0200 |
commit | c4f8be464c99090dabc6376222830dffe0bf5b12 (patch) | |
tree | a05ff2bc74696bd4120d48ee943a825de9bf6316 /test/functional/vimscript/null_spec.lua | |
parent | c3d21ad1bccd9a2975be73b1115213fd884eada3 (diff) | |
download | rneovim-c4f8be464c99090dabc6376222830dffe0bf5b12.tar.gz rneovim-c4f8be464c99090dabc6376222830dffe0bf5b12.tar.bz2 rneovim-c4f8be464c99090dabc6376222830dffe0bf5b12.zip |
docs(style): add guideline for fixing compiler error on switch statement
Problem: Certain compilers (primarily GCC) do not recognize an exhaustive enum switch statement as being exhaustive. This manifests in the form of compiler errors in exhaustive switch statements where each case has a return statement but there isn't a catch-all return statements. These compiler errors are spurious in the context of the Neovim codebase. So #25533 added the `UNREACHABLE` macro to denote apart of the code that's unreachable, which was used after every such switch statement to tell the compiler to treat the switch statement as exhaustive. However, the macro is mentioned nowhere in the style guide,and new contributors would not have any natural way of learning about it as it stands now. This would lead to confusion when they inevitably encounter one of these compiler errors.
Solution: Add a style guideline which shows how to use the `UNREACHABLE` macro to fix these compiler errors.
Diffstat (limited to 'test/functional/vimscript/null_spec.lua')
0 files changed, 0 insertions, 0 deletions