From 47638706a37534ae9bc7ac4c57ddb9fb2b44fef0 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sun, 12 Feb 2023 17:41:54 +0100 Subject: [PATCH] build: treat clang-tidy warnings as errors (#22238) --- .clang-tidy | 1 + src/nvim/eval.c | 2 +- src/nvim/ops.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 1fe87ba501..1c7d13e2b0 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,4 @@ +WarningsAsErrors: '*' Checks: > -*, diff --git a/src/nvim/eval.c b/src/nvim/eval.c index fb69734457..1a10f8aebc 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -3410,7 +3410,7 @@ static int eval_index(char **arg, typval_T *rettv, int evaluate, int verbose) if (n1 >= len || n2 < 0 || n1 > n2) { v = NULL; } else { - v = xmemdupz(s + n1, (size_t)(n2 - n1 + 1)); + v = xmemdupz(s + n1, (size_t)n2 - (size_t)n1 + 1); } } else { // The resulting variable is a string of a single diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 0fb8a8004b..e89844098b 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -923,7 +923,7 @@ int do_record(int c) dict_T *dict = get_v_event(&save_v_event); // The recorded text contents. - char *p = (char *)get_recorded(); + char *p = get_recorded(); if (p != NULL) { // Remove escaping for K_SPECIAL in multi-byte chars. vim_unescape_ks(p);