neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit fd791db0ecebf5d5bf8922ba519f8dd4eef3c5e6
parent eb1f0e8fcca756a00d287e23bf87554e0e7f6dfd
Author: dundargoc <33953936+dundargoc@users.noreply.github.com>
Date:   Tue,  3 Oct 2023 00:19:30 +0200

fix: fix ASAN errors on clang 17 (#25469)


Diffstat:
Msrc/nvim/cmdexpand.c | 4++--
Msrc/nvim/eval.c | 2+-
Msrc/nvim/ex_cmds.c | 2+-
Msrc/nvim/message.c | 3+--
Msrc/nvim/message.h | 1+
Msrc/nvim/os/fileio.c | 3++-
6 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c @@ -3078,7 +3078,7 @@ static int ExpandUserDefined(const char *const pat, expand_T *xp, regmatch_T *re *matches = NULL; *numMatches = 0; - char *const retstr = call_user_expand_func((user_expand_func_T)call_func_retstr, xp); + char *const retstr = call_user_expand_func(call_func_retstr, xp); if (retstr == NULL) { return FAIL; } @@ -3150,7 +3150,7 @@ static int ExpandUserList(expand_T *xp, char ***matches, int *numMatches) { *matches = NULL; *numMatches = 0; - list_T *const retlist = call_user_expand_func((user_expand_func_T)call_func_retlist, xp); + list_T *const retlist = call_user_expand_func(call_func_retlist, xp); if (retlist == NULL) { return FAIL; } diff --git a/src/nvim/eval.c b/src/nvim/eval.c @@ -1226,7 +1226,7 @@ fail: /// /// @return [allocated] NULL when calling function fails, allocated string /// otherwise. -char *call_func_retstr(const char *const func, int argc, typval_T *argv) +void *call_func_retstr(const char *const func, int argc, typval_T *argv) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_MALLOC { typval_T rettv; diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c @@ -131,7 +131,7 @@ static const char e_non_numeric_argument_to_z[] = N_("E144: Non-numeric argument to :z"); /// ":ascii" and "ga" implementation -void do_ascii(const exarg_T *const eap) +void do_ascii(exarg_T *eap) { char *dig; int cc[MAX_MCO]; diff --git a/src/nvim/message.c b/src/nvim/message.c @@ -1025,10 +1025,9 @@ int delete_first_msg(void) } /// :messages command implementation -void ex_messages(void *const eap_p) +void ex_messages(exarg_T *eap) FUNC_ATTR_NONNULL_ALL { - const exarg_T *const eap = (const exarg_T *)eap_p; struct msg_hist *p; if (strcmp(eap->arg, "clear") == 0) { diff --git a/src/nvim/message.h b/src/nvim/message.h @@ -7,6 +7,7 @@ #include "klib/kvec.h" #include "nvim/api/private/defs.h" +#include "nvim/ex_cmds_defs.h" #include "nvim/grid_defs.h" #include "nvim/macros.h" #include "nvim/types.h" diff --git a/src/nvim/os/fileio.c b/src/nvim/os/fileio.c @@ -282,9 +282,10 @@ static char writebuf[kRWBufferSize]; /// /// @param[in,out] rv RBuffer instance used. /// @param[in,out] fp File to work with. -static void file_rb_write_full_cb(RBuffer *const rv, FileDescriptor *const fp) +static void file_rb_write_full_cb(RBuffer *const rv, void *const fp_in) FUNC_ATTR_NONNULL_ALL { + FileDescriptor *const fp = fp_in; assert(fp->wr); assert(rv->data == (void *)fp); if (rbuffer_size(rv) == 0) {