On 03-Sept-2022 21:09, Bram Moolenaar wrote:
Patch 9.0.0366
Problem:    Cannot use import->Func() in lambda. (Israel Chauca Fuentes)
Solution:   Adjust how an expression in a lambda is parsed. (closes #11042)
Files:      src/eval.c, src/testdir/test_vim9_import.vim


After this patch mingw64 (gcc 12.2.0) spits out 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 eval.c -o gobjnative/eval.o
In function 'deref_function_name',
    inlined from 'eval_method' at eval.c:4392:14,
    inlined from 'handle_subscript' at eval.c:6451:13:
eval.c:756:29: warning: 'save_flags' may be used uninitialized [-Wmaybe-uninitialized]
  756 |         evalarg->eval_flags = save_flags;
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
eval.c: In function 'handle_subscript':
eval.c:697:17: note: 'save_flags' was declared here
  697 |     int         save_flags;
      |                 ^~~~~~~~~~
</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/bfb5875b-93ea-e182-6529-6a66a6c9d286%40internode.on.net.
--- eval.c.orig 2022-09-04 05:09:47.575898000 +1000
+++ eval.c      2022-09-04 05:13:40.942988700 +1000
@@ -694,7 +694,7 @@
 {
     typval_T   ref;
     char_u     *name = *arg;
-    int                save_flags;
+    int                save_flags = 0;
 
     ref.v_type = VAR_UNKNOWN;
     if (evalarg != NULL)

Raspunde prin e-mail lui