changeset 26950:e682a58399c1 v8.2.4004

patch 8.2.4004: old compiler complains about struct init with variable Commit: https://github.com/vim/vim/commit/548911ee145cdd166f20e46aa720d1631e66f64e Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 4 20:05:04 2022 +0000 patch 8.2.4004: old compiler complains about struct init with variable Problem: Old compiler complains about struct init with variable. Solution: Set the struct member later. (John Marriott)
author Bram Moolenaar <Bram@vim.org>
date Tue, 04 Jan 2022 21:15:04 +0100
parents ef3fe9afe119
children c3fbe78b6109
files src/evalfunc.c src/version.c
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -524,9 +524,9 @@ arg_map_func(type_T *type, type_T *decl_
 	    expected = &t_number;
 	if (expected != NULL)
 	{
-	    type_T t_func_exp = {VAR_FUNC, -1, 0, TTFLAG_STATIC,
-							       expected, NULL};
-
+	    type_T t_func_exp = {VAR_FUNC, -1, 0, TTFLAG_STATIC, NULL, NULL};
+
+	    t_func_exp.tt_member = expected;
 	    return check_arg_type(&t_func_exp, type, context);
 	}
     }
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4004,
+/**/
     4003,
 /**/
     4002,