Christian wrote:

> On So, 28 Apr 2019, Bram Moolenaar wrote:
> 
> > Patch 8.1.1228
> > Problem:    Not possible to process tags with a function.
> > Solution:   Add tagfunc() (Christian Brabandt, Andy Massimino, closes #4010)
> 
> I see some warnings on appveyor after this patch. Can you please include 
> the following patch:
> 
> diff --git a/src/tag.c b/src/tag.c
> index 5ab4eaab2..1242668a8 100644
> --- a/src/tag.c
> +++ b/src/tag.c
> @@ -1391,7 +1391,7 @@ find_tagfunc_tags(
>             if (tv->v_type != VAR_STRING || tv->vval.v_string == NULL)
>                 continue;
> 
> -           len += STRLEN(tv->vval.v_string) + 1;   // Space for "\tVALUE"
> +           len += (int)STRLEN(tv->vval.v_string) + 1;   // Space for 
> "\tVALUE"
>             if (!STRCMP(dict_key, "name"))
>             {
>                 res_name = tv->vval.v_string;
> @@ -1415,7 +1415,7 @@ find_tagfunc_tags(
>             }
>             // Other elements will be stored as "\tKEY:VALUE"
>             // Allocate space for the key and the colon
> -           len += STRLEN(dict_key) + 1;
> +           len += (int)STRLEN(dict_key) + 1;
>         }
> 
>         if (has_extra)

I'll include the type casts, thanks.

> (Perhaps the STRLEN macro should always cast to (int)?)

Well, it might be dropping bits if int is 32 bits and size_t is 64 bits.
It's very rare this causes trouble, but the type cast is a good reminder
to check.

-- 
ARTHUR:        A scratch?  Your arm's off!
BLACK KNIGHT:  No, it isn't.
ARTHUR:        Well, what's that then?
BLACK KNIGHT:  I've had worse.
                                  The Quest for the Holy Grail (Monty Python)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui