aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/charset.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2021-01-31 10:43:03 -0500
committerJames McCoy <jamessan@jamessan.com>2021-01-31 11:28:52 -0500
commit27a7a4d38405a30611339fc663e426904bda1099 (patch)
tree23935162b10ba9fa607df9a35ea3b3da7ea9349e /src/nvim/charset.c
parent035ee868ae2d9cbbf2a290ca3412946fade20833 (diff)
downloadrneovim-27a7a4d38405a30611339fc663e426904bda1099.tar.gz
rneovim-27a7a4d38405a30611339fc663e426904bda1099.tar.bz2
rneovim-27a7a4d38405a30611339fc663e426904bda1099.zip
Use abort() instead of assert(false) for things that should never happen
assert() is compiled out for release builds, but we don't want to continue running in these impossible situations. This also resolves the "implicit fallthrough" warnings for the asserts in switch cases.
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r--src/nvim/charset.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index 3e52b3e3ce..be265e3f27 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -1747,7 +1747,7 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len,
goto vim_str2nr_dec;
}
default: {
- assert(false);
+ abort();
}
}
} else if ((what & (STR2NR_HEX|STR2NR_OCT|STR2NR_BIN))
@@ -1788,7 +1788,7 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len,
}
// Do the string-to-numeric conversion "manually" to avoid sscanf quirks.
- assert(false); // Should’ve used goto earlier.
+ abort(); // Should’ve used goto earlier.
#define PARSE_NUMBER(base, cond, conv) \
do { \
while (!STRING_ENDED(ptr) && (cond)) { \