]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.2048: python: uninitialized warning v9.0.2048
authorKen Takata <kentkt@csc.jp>
Wed, 18 Oct 2023 10:02:24 +0000 (12:02 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 18 Oct 2023 10:03:41 +0000 (12:03 +0200)
Problem:  python: uninitialized warning
Solution: initialize 'minor' always

win32,py3: Fix uninitialized warning

Fix the following warning:
```
if_python3.c: In function 'py3_get_system_libname':
if_python3.c:879:16: warning: 'minor' may be used uninitialized [-Wmaybe-uninitialized]
  879 |             if (minor == PY_MINOR_VERSION)
      |                ^
if_python3.c:839:24: note: 'minor' was declared here
  839 |         long    major, minor;
      |                        ^~~~~
```

closes: #13368

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
src/if_python3.c
src/version.c

index c39f42a6c798c5c47e72ca527bc778f6b5038e5e..c135e7e6fddd0955504172b50a6ae5cc1d2da57b 100644 (file)
@@ -848,8 +848,9 @@ py3_get_system_libname(const char *libname)
                break;
 
            major = wcstol(keyname, &wp, 10);
-           if (*wp == L'.')
-               minor = wcstol(wp + 1, &wp, 10);
+           if (*wp != L'.')
+               continue;
+           minor = wcstol(wp + 1, &wp, 10);
 #  ifdef _WIN64
            if (*wp != L'\0')
                continue;
index f839c28159d7fe106eb73e4a788cb98741d35d68..977bbdf6fe2954ae89623e0753a0d1397a2e51c3 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2048,
 /**/
     2047,
 /**/