]> granicus.if.org Git - vim/commitdiff
patch 8.2.1884: compiler warning for uninitialized variable v8.2.1884
authorBram Moolenaar <Bram@vim.org>
Thu, 22 Oct 2020 10:31:49 +0000 (12:31 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 22 Oct 2020 10:31:49 +0000 (12:31 +0200)
Problem:    Compiler warning for uninitialized variable. (John Marriott)
Solution:   Initialize with NULL.

src/evalfunc.c
src/version.c
src/vim9compile.c

index 41133091d5d3b6993c3a7362d06a154842ee964f..72dc557f91b6895e0714b964d0da0122bb332637 100644 (file)
@@ -331,6 +331,7 @@ argcheck_T arg3_insert[] = {arg_list_or_blob, arg_item_of_prev, arg_number};
 
 /*
  * Functions that return the return type of a builtin function.
+ * Note that "argtypes" is NULL if "argcount" is zero.
  */
     static type_T *
 ret_void(int argcount UNUSED, type_T **argtypes UNUSED)
@@ -1825,6 +1826,11 @@ internal_func_check_arg_types(type_T **types, int idx, int argcount)
     return OK;
 }
 
+/*
+ * Call the "f_retfunc" function to obtain the return type of function "idx".
+ * "argtypes" is the list of argument types or NULL when there are no
+ * arguments.
+ */
     type_T *
 internal_func_ret_type(int idx, int argcount, type_T **argtypes)
 {
index 720dc3a83cc52e74bcc5ee3c9927cfff0ff39de3..56bf8f665b6839b59235b35bb35b8b3cd047b917 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1884,
 /**/
     1883,
 /**/
index 7ae47b393deb189cffcae64108e4bbc3f6ed1aff..58f4db9b724fc333bc1d4b6ce6596f4ea54fe978 100644 (file)
@@ -1460,7 +1460,7 @@ generate_BCALL(cctx_T *cctx, int func_idx, int argcount, int method_call)
     isn_T      *isn;
     garray_T   *stack = &cctx->ctx_type_stack;
     int                argoff;
-    type_T     **argtypes;
+    type_T     **argtypes = NULL;
 
     RETURN_OK_IF_SKIP(cctx);
     argoff = check_internal_func(func_idx, argcount);