John Marriott wrote:

> On 28-May-2022 03:06, Bram Moolenaar wrote:
> > Patch 8.2.5030
> > Problem:    autocmd_add() can only handle one event and pattern.
> > Solution:   Support a list of events and patterns. (Yegappan Lakshmanan,
> >              closes #10483)
> > Files:      runtime/doc/builtin.txt, src/autocmd.c, src/errors.h,
> >              src/testdir/test_autocmd.vim
> >
> >
> >
> After this patch mingw64 (gcc 11.3.0) spits out this error if 
> FEAT_QUICKFIX is not defined:
> <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 autocmd.c -o 
> gobjnative/autocmd.o
> In file included from autocmd.c:14:
> autocmd.c: In function 'autocmd_add_or_delete':
> autocmd.c:2828:24: error: 'e_string_or_list_expected' undeclared (first 
> use in this function)
>   2828 |                 emsg(_(e_string_or_list_expected));
>        |                        ^~~~~~~~~~~~~~~~~~~~~~~~~
> vim.h:564:25: note: in definition of macro '_'
>    564 | # define _(x) ((char *)(x))
>        |                         ^
> autocmd.c:2828:24: note: each undeclared identifier is reported only 
> once for each function it appears in
>   2828 |                 emsg(_(e_string_or_list_expected));
>        |                        ^~~~~~~~~~~~~~~~~~~~~~~~~
> vim.h:564:25: note: in definition of macro '_'
>    564 | # define _(x) ((char *)(x))
>        |                         ^
> make: *** [Make_cyg_ming.mak:1187: gobjnative/autocmd.o] Error 1
> </snip>
> 
> The attached patch of errors.h tries to fix it.

Looks good.

> After applying this patch, mingw64 then spat 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 autocmd.c -o 
> gobjnative/autocmd.o
> autocmd.c: In function 'f_autocmd_add':
> autocmd.c:2967:20: warning: 'p' may be used uninitialized in this 
> function [-Wmaybe-uninitialized]
>   2967 |                 if (p == NULL)
>        |                    ^
> autocmd.c:2772:18: note: 'p' was declared here
>   2772 |     char_u      *p;
>        |                  ^
> autocmd.c: In function 'f_autocmd_delete':
> autocmd.c:2967:20: warning: 'p' may be used uninitialized in this 
> function [-Wmaybe-uninitialized]
>   2967 |                 if (p == NULL)
>        |                    ^
> autocmd.c:2772:18: note: 'p' was declared here
>   2772 |     char_u      *p;
>        |                  ^
> </snip>
> 
> The attached patch of autocmd.c tries to fix it.

Also looks good.

-- 
FIRST GUARD: Ah!  Now ... we're not allowed to ...
   SIR LAUNCELOT runs him through,  grabs his spear and stabs the other
   guard who collapses in a heap.  Hiccoughs quietly.
                 "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/20220527201706.455911C1929%40moolenaar.net.

Raspunde prin e-mail lui