From 26b84a8b3e99d9dce2ad9f34e1663f119cd1c558 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 16 Mar 2018 07:34:27 +0100 Subject: build/MSVC: fix "C4003: not enough actual parameters for macro" For the case of TV_DICTITEM_STRUCT, we can't just pass `1` because: https://github.com/neovim/neovim/pull/8142#discussion_r175262436 > this variant will trigger array overrun warnings from various static analyzers. --- src/nvim/eval/typval.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/eval/typval.h') diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index 40a1738d9e..2272a580d6 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -206,11 +206,11 @@ struct dictitem_S { char_u di_key[1]; ///< key (actually longer!) }; -#define TV_DICTITEM_STRUCT(KEY_LEN) \ +#define TV_DICTITEM_STRUCT(...) \ struct { \ typval_T di_tv; /* Structure that holds scope dictionary itself. */ \ uint8_t di_flags; /* Flags. */ \ - char_u di_key[KEY_LEN]; /* Key value. */ \ + char_u di_key[__VA_ARGS__]; /* Key value. */ \ } /// Structure to hold a scope dictionary -- cgit