John Marriott wrote:

> On 31-Jan-2022 05:41, Bram Moolenaar wrote:
> > Patch 8.2.4264
> > Problem:    Vim9: can use old style autoload function name.
> > Solution:   Give an error for old style autoload function name.
> > Files:      src/errors.h, src/userfunc.c, src/testdir/test_vim9_import.vim,
> >              src/testdir/test_vim9_func.vim, 
> > src/testdir/test_vim9_script.vim
> >
> >
> >
> After this patch, mingw64 (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 userfunc.c -o 
> gobjnative/userfunc.o
> userfunc.c: In function 'define_function':
> userfunc.c:4833:14: warning: 'saved_did_emsg' may be used uninitialized 
> in this function [-Wmaybe-uninitialized]
>   4833 |     did_emsg |= saved_did_emsg;
>        |              ^~
> </snip>
> 
> The attached patch tries to fix it.

I saw your patch only after sending out patch 8.2.4266.  The effect
should be the same.

> By the way, are we sure that line 4833 (did_emsg |= saved_did_emsg) is 
> correct? Shouldn't it be: did_emsg = save_did_emsg?

We don't want to reset did_emsg here.  It's a corner case anyway, the
comment mentions "magic braces":

    // An error in a function call during evaluation of an expression in magic
    // braces should not cause the function not to be defined.

I'm not sure this is true, we usually abort when an error is detected.
But I don't like to change old behavior unless we know why it was done
that way.


-- 
DENNIS: You can't expect to wield supreme executive power just 'cause some
        watery tart threw a sword at you!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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/20220130200141.5BC2E1C1918%40moolenaar.net.

Raspunde prin e-mail lui