John Marriott wrote: > On 03-Sep-2017 04:30, Bram Moolenaar wrote: > > Patch 8.0.1041 > > Problem: Bogus characters appear when indenting kicks in while doing a > > visual-block append. > > Solution: Recompute when indenting is done. (Christian Brabandt) > > Files: runtime/doc/visual.txt, src/charset.c, src/edit.c, src/misc1.c, > > src/ops.c, src/proto/charset.pro, src/proto/misc1.pro, > > src/screen.c, src/spell.c, src/testdir/test_cindent.vim > > > > > After this patch, mingw (x64) throws this warning (on Win8.1 x64): > gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 > -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_W32 > -DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer > -freg-struct-return -s ops.c -o gobjnative/ops.o > ops.c: In function 'op_insert': > ops.c:2605:25: warning: 'ind_pre' may be used uninitialized in this > function [-Wmaybe-uninitialized] > bd.textcol += ind_post - ind_pre; > ~~~~~~~~~^~~~~~~~~ > > > ind_post is set unconditionally on line 2602, but ind_pre is only set if > oap->block_mode is true. > The attached patch tries to fix it by initialising it to 0. Please check. > > I am concerned about the struct block_def variable 'bd' (declared on > line 2511). It's .is_MAX member is set unconditionally (line 2516), but > it's other members only seem to be set via the call to block_prep() if > oap->block_mode is true (line 2544). Or am I missing something?
The code using ind_pre should be inside the if for block_mode. That should fix the warning and make sure "bd" is only set when it's used. -- hundred-and-one symptoms of being an internet addict: 55. You ask your doctor to implant a gig in your brain. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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]. For more options, visit https://groups.google.com/d/optout.
