]> granicus.if.org Git - vim/commitdiff
patch 8.2.4004: old compiler complains about struct init with variable v8.2.4004
authorBram Moolenaar <Bram@vim.org>
Tue, 4 Jan 2022 20:05:04 +0000 (20:05 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 4 Jan 2022 20:05:04 +0000 (20:05 +0000)
Problem:    Old compiler complains about struct init with variable.
Solution:   Set the struct member later. (John Marriott)

src/evalfunc.c
src/version.c

index 8cb2d755d594f098a2468231ceed93b1346805e4..bb8f83b97fd7ccafa1e1bd2fced7e0d9f7629671 100644 (file)
@@ -524,9 +524,9 @@ arg_map_func(type_T *type, type_T *decl_type UNUSED, argcontext_T *context)
            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);
        }
     }
index f657caa5e4c9ceff06e9089dff4231ec969c6cff..a7ffa77b468352634f1aebeb0c188e1ba972ed26 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4004,
 /**/
     4003,
 /**/