]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1724: Compiler warning about ununitialized variable in ex_docmd. v9.1.1724
authormityu <mityu.mail@gmail.com>
Mon, 1 Sep 2025 17:18:46 +0000 (19:18 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 1 Sep 2025 17:18:46 +0000 (19:18 +0200)
Problem:  Compiler warning about ununitialized variable in ex_docmd.
Solution: Initialize result variable (mityu)

Silence uninitialized variable warning produced by clang 21.1.0

closes: #18182

Signed-off-by: mityu <mityu.mail@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ex_docmd.c
src/version.c

index 3e48aed7953474154ae0e7523aff85b6c44ef501..9d7e58ed9c1b9ec28a24188cc2f80062a442ec22 100644 (file)
@@ -9773,7 +9773,7 @@ eval_vars(
 {
     int                i;
     char_u     *s;
-    char_u     *result;
+    char_u     *result = (char_u *)"";
     char_u     *resultbuf = NULL;
     size_t     resultlen;
     buf_T      *buf;
@@ -10064,10 +10064,6 @@ eval_vars(
 #endif
                break;
 #endif
-
-       default:
-               result = (char_u *)""; // avoid gcc warning
-               break;
        }
 
        resultlen = STRLEN(result);     // length of new string
index 903c459b9563ff875e95079e15fee36ae245bd0c..5603415e664cca83f735ce662df36bb67c042f99 100644 (file)
@@ -724,6 +724,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1724,
 /**/
     1723,
 /**/