After this patch, mingw (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 indent.c -o gobjnative/indent.o
indent.c: In function 'op_reindent':
indent.c:1118:34: warning: 'i' may be used uninitialized in this function [-Wmaybe-uninitialized]
 1118 |         i = oap->line_count - (i + 1);
      |                               ~~~^~~~
</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/1dd96083-42d1-fe7c-1ad9-5de8c3fc9efb%40internode.on.net.
--- indent.c.orig       2022-04-20 05:43:23.489963300 +1000
+++ indent.c    2022-04-20 05:48:25.280911900 +1000
@@ -1046,7 +1046,7 @@
     void
 op_reindent(oparg_T *oap, int (*how)(void))
 {
-    long       i;
+    long       i = 0;
     char_u     *l;
     int                amount;
     linenr_T   first_changed = 0;

Raspunde prin e-mail lui