John Marriott wrote:

> On 28-Apr-2020 06:48, Bram Moolenaar wrote:
> > Patch 8.2.0650
> > Problem:    Vim9: script function can be deleted.
> > Solution:   Disallow deleting script function.  Delete functions when 
> > sourcing
> >              a script again.
> > Files:      src/userfunc.c, src/proto/userfunc.pro, src/evalfunc.c,
> >              src/vim9compile.c, src/vim9execute.c, src/vim9script.c,
> >              src/scriptfile.c, src/testing.c, 
> > src/testdir/test_vim9_expr.vim,
> >              src/testdir/test_vim9_func.vim, 
> > src/testdir/test_vim9_script.vim
> >
> >
> After this patch, mingw64 (gcc 9.3.1) spits out this warning:
> gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
> -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_MSWIN 
> -DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer 
> -freg-struct-return userfunc.c -o gobjnative/userfunc.o
> In file included from userfunc.c:14:
> userfunc.c: In function 'delete_script_functions':
> vim.h:1594:45: warning: 'fp' may be used uninitialized in this function 
> [-Wmaybe-uninitialized]
>   1594 | #define STRNCMP(d, s, n)    strncmp((char *)(d), (char *)(s), 
> (size_t)(n))
>        |                                             ^
> userfunc.c:1587:14: note: 'fp' was declared here
>   1587 |     ufunc_T *fp;
>        |              ^~

Thanks for the patch.  I'm very surprised the test didn't catch this.

-- 
If they don't keep on exercising their lips, he thought, their brains
start working.
                -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202004272139.03RLd7ZA012992%40masaka.moolenaar.net.

Raspunde prin e-mail lui