On 28-Feb-2022 08:03, Bram Moolenaar wrote:
Patch 8.2.4482
Problem:    No fuzzy cmdline completion for user defined completion.
Solution:   Add fuzzy completion for user defined completion. (Yegappan
             Lakshmanan, closes #9858)
Files:      src/cmdexpand.c, src/testdir/test_cmdline.vim



After this patch, mingw64 (gcc 11.2.0) throws this warning:
<snip>
gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD cmdexpand.c -o gobjnative/cmdexpand.o
cmdexpand.c: In function 'ExpandFromContext':
cmdexpand.c:3056:33: warning: 'score' may be used uninitialized in this function [-Wmaybe-uninitialized]
 3056 |                 fuzmatch->score = score;
      |                 ~~~~~~~~~~~~~~~~^~~~~~~
cmdexpand.c:3006:17: note: 'score' was declared here
 3006 |     int         score;
      |                 ^~~~~
</snip>

The attached patch tries to fix it.
Cheers
John

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/3d9eba67-11c9-2f42-abb5-45cb756b7e4a%40internode.on.net.
--- cmdexpand.c.orig    2022-03-01 05:56:52.611353000 +1100
+++ cmdexpand.c 2022-03-01 06:17:08.904664100 +1100
@@ -3003,7 +3003,7 @@
     garray_T   ga;
     int                fuzzy;
     int                match;
-    int                score;
+    int                score = 0;
 
     fuzzy = cmdline_fuzzy_complete(pat);
     *matches = NULL;

Raspunde prin e-mail lui