John Marriott wrote:

> On 06-Jun-2021 04:52, Bram Moolenaar wrote:
> > Patch 8.2.2944
> > Problem:    Vim9: no error when using job or channel as a string.
> > Solution:   Be more strict about conversion to string. (closes #8312)
> > Files:      src/typval.c, src/job.c, src/proto/job.pro, src/channel.c,
> >              src/proto/channel.pro, src/eval.c, src/vim9execute.c,
> >              src/testdir/test_vim9_builtin.vim
> >
> >
> After this patch, mingw64 (gcc 11.1.0) throws this warning and then this 
> linker error if FEAT_JOB_CHANNEL is disabled:
> <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
> eval.c: In function 'echo_string_core':
> eval.c:5063:41: warning: implicit declaration of function 
> 'job_to_string_buf' [-Wimplicit-function-declaration]
>   5063 |             r = tv->v_type == VAR_JOB ? job_to_string_buf(tv, 
> numbuf)
>        |                                         ^~~~~~~~~~~~~~~~~
> eval.c:5064:46: warning: implicit declaration of function 
> 'channel_to_string_buf' [-Wimplicit-function-declaration]
>   5064 |                                            : 
> channel_to_string_buf(tv, numbuf);
>        | ^~~~~~~~~~~~~~~~~~~~~
> eval.c:5063:15: warning: assignment to 'char_u *' {aka 'unsigned char 
> *'} from 'int' makes pointer from integer without a cast [-Wint-conversion]
>   5063 |             r = tv->v_type == VAR_JOB ? job_to_string_buf(tv, 
> numbuf)
>        |               ^
> </snip>
> 
> The attachment patch tries to fix it.

Thanks, I moved the #ifdef instead of copying it.

-- 
MICHAEL PALIN PLAYED: 1ST SOLDIER WITH A KEEN INTEREST IN BIRDS, DENNIS, MR
                      DUCK (A VILLAGE CARPENTER WHO IS ALMOST KEENER THAN
                      ANYONE ELSE TO BURN WITCHES), THREE-HEADED KNIGHT, SIR
                      GALAHAD, KING OF SWAMP CASTLE, BROTHER MAYNARD'S ROOMATE
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202106061001.156A12D2259158%40masaka.moolenaar.net.

Raspunde prin e-mail lui