patch 9.0.1284: compiler warnings for uninitialized variables v9.0.1284
authorBram Moolenaar <Bram@vim.org>
Sun, 5 Feb 2023 17:04:50 +0000 (17:04 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 5 Feb 2023 17:04:50 +0000 (17:04 +0000)
Problem:    Compiler warnings for uninitialized variables. (Tony Mechelynck)
Solution:   Add variable initializations.

src/option.c
src/version.c

index f22f9f37efc21e34ec0f6a999db523ecb73c2df0..420d36d05c239831255267d928403a502d736756 100644 (file)
@@ -2096,7 +2096,6 @@ do_set_option(
     char_u     key_name[2];
     int                nextchar;       // next non-white char after option name
     int                afterchar;      // character just after option name
-    int                cp_val;
     char       *errmsg = NULL;
     int                key;
     int                len;
@@ -2167,6 +2166,7 @@ do_set_option(
     else
     {
        flags = P_STRING;
+       varp = NULL;
        if (key < 0)
        {
            key_name[0] = KEY2TERMCAP0(key);
@@ -2183,10 +2183,10 @@ do_set_option(
     if (validate_opt_idx(opt_idx, opt_flags, flags, &errmsg) == FAIL)
        goto skip;
 
+    int cp_val = p_cp;
     if (vim_strchr((char_u *)"?=:!&<", nextchar) != NULL)
     {
        arg += len;
-       cp_val = p_cp;
        if (nextchar == '&' && arg[1] == 'v' && arg[2] == 'i')
        {
            if (arg[3] == 'm')  // "opt&vim": set to Vim default
index fb8795b160bc8e465823781e9e23846eb209309c..97767d292fd77c31d94769bd671ea7b9aad392f7 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1284,
 /**/
     1283,
 /**/