On 25-May-2020 07:00, Bram Moolenaar wrote:
Patch 8.2.0818
Problem: Vim9: using a discovery phase doesn't work well.
Solution: Remove the discovery phase, instead compile a function only when
it is used. Add :defcompile to compile def functions earlier.
Files: runtime/doc/vim9.txt, src/vim9script.c, src/structs.h,
src/userfunc.c, src/proto/userfunc.pro, src/eval.c,
src/evalvars.c, src/proto/evalvars.pro, src/vim9compile.c,
src/proto/vim9compile.pro, src/vim9execute.c, src/ex_cmds.h,
src/ex_docmd.c, src/ex_cmdidxs.h, src/vim.h, src/testdir/vim9.vim,
src/testdir/test_vim9_disassemble.vim
src/testdir/test_vim9_func.vim, src/testdir/test_vim9_script.vim
After this patch mingw (gcc 10.1) gives this warning:
<snip>
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 evalvars.c -o gobjnative/evalvars.o
evalvars.c: In function 'ex_let_const':
evalvars.c:780:6: warning: unused variable 'save_called_emsg'
[-Wunused-variable]
780 | int save_called_emsg = called_emsg;
| ^~~~~~~~~~~~~~~~
</snip>
Please check the attached patch.
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/ed6b48bd-8ece-c74a-3128-f5d04e60da7a%40internode.on.net.
--- evalvars.c.orig 2020-05-25 07:02:29.485669300 +1000
+++ evalvars.c 2020-05-25 07:05:57.768010100 +1000
@@ -777,7 +777,6 @@
else
{
int eval_flags;
- int save_called_emsg = called_emsg;
rettv.v_type = VAR_UNKNOWN;
i = FAIL;