summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-21 18:56:58 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-21 18:56:58 +0100
commit5a01caa90428a5f87600528d68529383c0b2f78c (patch)
tree7c8e52c725b449c319eee9d96b1b33525790e76a
parent93c1573dd284dc9cf5ed9265a0143aaf520d2920 (diff)
patch 8.2.4992: compiler warning for possibly uninitialized variablev8.2.4992
Problem: Compiler warning for possibly uninitialized variable. (Tony Mechelynck) Solution: Initialize variable in the caller instead of in the function.
-rw-r--r--src/userfunc.c4
-rw-r--r--src/version.c2
-rw-r--r--src/vim9execute.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index bc4bc45036..cc477fed33 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -4999,6 +4999,7 @@ ex_function(exarg_T *eap)
/*
* Find a function by name, including "<lambda>123".
* Check for "profile" and "debug" arguments and set"compile_type".
+ * Caller should initialize "compile_type" to CT_NONE.
* Return NULL if not found.
*/
ufunc_T *
@@ -5009,7 +5010,6 @@ find_func_by_name(char_u *name, compiletype_T *compile_type)
ufunc_T *ufunc;
int is_global = FALSE;
- *compile_type = CT_NONE;
if (STRNCMP(arg, "profile", 7) == 0 && VIM_ISWHITE(arg[7]))
{
*compile_type = CT_PROFILE;
@@ -5069,7 +5069,7 @@ ex_defcompile(exarg_T *eap)
if (*eap->arg != NUL)
{
- compiletype_T compile_type;
+ compiletype_T compile_type = CT_NONE;
ufunc = find_func_by_name(eap->arg, &compile_type);
if (ufunc != NULL)
diff --git a/src/version.c b/src/version.c
index bde9fe87a5..7cd81892ee 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4992,
+/**/
4991,
/**/
4990,
diff --git a/src/vim9execute.c b/src/vim9execute.c
index d89f442367..eb07a38c30 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -6281,7 +6281,7 @@ ex_disassemble(exarg_T *eap)
dfunc_T *dfunc;
isn_T *instr;
int instr_count;
- compiletype_T compile_type;
+ compiletype_T compile_type = CT_NONE;
ufunc = find_func_by_name(arg, &compile_type);
if (ufunc == NULL)