mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 8.2.0436: no warnings for incorrect printf arguments
Problem: No warnings for incorrect printf arguments. Solution: Fix attribute in declaration. Fix uncovered mistakes. (Dominique Pelle, closes #5834)
This commit is contained in:
parent
dbbb0ef729
commit
db99f9f29a
@ -2848,7 +2848,7 @@ eval_lambda(
|
|||||||
if (verbose)
|
if (verbose)
|
||||||
{
|
{
|
||||||
if (*skipwhite(*arg) == '(')
|
if (*skipwhite(*arg) == '(')
|
||||||
semsg(_(e_nowhitespace));
|
emsg(_(e_nowhitespace));
|
||||||
else
|
else
|
||||||
semsg(_(e_missing_paren), "lambda");
|
semsg(_(e_missing_paren), "lambda");
|
||||||
}
|
}
|
||||||
@ -2910,7 +2910,7 @@ eval_method(
|
|||||||
else if (VIM_ISWHITE((*arg)[-1]))
|
else if (VIM_ISWHITE((*arg)[-1]))
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
semsg(_(e_nowhitespace));
|
emsg(_(e_nowhitespace));
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -542,7 +542,7 @@ gui_init(void)
|
|||||||
if (STRCMP(use_gvimrc, "NONE") != 0
|
if (STRCMP(use_gvimrc, "NONE") != 0
|
||||||
&& STRCMP(use_gvimrc, "NORC") != 0
|
&& STRCMP(use_gvimrc, "NORC") != 0
|
||||||
&& do_source(use_gvimrc, FALSE, DOSO_NONE, NULL) != OK)
|
&& do_source(use_gvimrc, FALSE, DOSO_NONE, NULL) != OK)
|
||||||
semsg(_("E230: Cannot read from \"%s\""), use_gvimrc, NULL);
|
semsg(_("E230: Cannot read from \"%s\""), use_gvimrc);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2999,7 +2999,7 @@ op_addsub(
|
|||||||
curbuf->b_op_start = startpos;
|
curbuf->b_op_start = startpos;
|
||||||
|
|
||||||
if (change_cnt > p_report)
|
if (change_cnt > p_report)
|
||||||
smsg(NGETTEXT("%ld line changed", "%ld lines changed",
|
smsg(NGETTEXT("%d line changed", "%d lines changed",
|
||||||
change_cnt), change_cnt);
|
change_cnt), change_cnt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ extern int _stricoll(char *a, char *b);
|
|||||||
// These prototypes cannot be produced automatically.
|
// These prototypes cannot be produced automatically.
|
||||||
int smsg(const char *, ...)
|
int smsg(const char *, ...)
|
||||||
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
|
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
|
||||||
__attribute__((format(printf, 1, 0)))
|
__attribute__((format(printf, 1, 2)))
|
||||||
# endif
|
# endif
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -138,14 +138,14 @@ int smsg_attr_keep(int, const char *, ...)
|
|||||||
// These prototypes cannot be produced automatically.
|
// These prototypes cannot be produced automatically.
|
||||||
int semsg(const char *, ...)
|
int semsg(const char *, ...)
|
||||||
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
|
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
|
||||||
__attribute__((format(printf, 1, 0)))
|
__attribute__((format(printf, 1, 2)))
|
||||||
# endif
|
# endif
|
||||||
;
|
;
|
||||||
|
|
||||||
// These prototypes cannot be produced automatically.
|
// These prototypes cannot be produced automatically.
|
||||||
void siemsg(const char *, ...)
|
void siemsg(const char *, ...)
|
||||||
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
|
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
|
||||||
__attribute__((format(printf, 1, 0)))
|
__attribute__((format(printf, 1, 2)))
|
||||||
# endif
|
# endif
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -4115,7 +4115,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
|
|||||||
pc = string_convert(&spin->si_conv, rline, NULL);
|
pc = string_convert(&spin->si_conv, rline, NULL);
|
||||||
if (pc == NULL)
|
if (pc == NULL)
|
||||||
{
|
{
|
||||||
smsg(_("Conversion failure for word in %s line %d: %s"),
|
smsg(_("Conversion failure for word in %s line %ld: %s"),
|
||||||
fname, lnum, rline);
|
fname, lnum, rline);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -4133,10 +4133,10 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
|
|||||||
if (STRNCMP(line, "encoding=", 9) == 0)
|
if (STRNCMP(line, "encoding=", 9) == 0)
|
||||||
{
|
{
|
||||||
if (spin->si_conv.vc_type != CONV_NONE)
|
if (spin->si_conv.vc_type != CONV_NONE)
|
||||||
smsg(_("Duplicate /encoding= line ignored in %s line %d: %s"),
|
smsg(_("Duplicate /encoding= line ignored in %s line %ld: %s"),
|
||||||
fname, lnum, line - 1);
|
fname, lnum, line - 1);
|
||||||
else if (did_word)
|
else if (did_word)
|
||||||
smsg(_("/encoding= line after word ignored in %s line %d: %s"),
|
smsg(_("/encoding= line after word ignored in %s line %ld: %s"),
|
||||||
fname, lnum, line - 1);
|
fname, lnum, line - 1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4159,13 +4159,13 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
|
|||||||
if (STRNCMP(line, "regions=", 8) == 0)
|
if (STRNCMP(line, "regions=", 8) == 0)
|
||||||
{
|
{
|
||||||
if (spin->si_region_count > 1)
|
if (spin->si_region_count > 1)
|
||||||
smsg(_("Duplicate /regions= line ignored in %s line %d: %s"),
|
smsg(_("Duplicate /regions= line ignored in %s line %ld: %s"),
|
||||||
fname, lnum, line);
|
fname, lnum, line);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
line += 8;
|
line += 8;
|
||||||
if (STRLEN(line) > MAXREGIONS * 2)
|
if (STRLEN(line) > MAXREGIONS * 2)
|
||||||
smsg(_("Too many regions in %s line %d: %s"),
|
smsg(_("Too many regions in %s line %ld: %s"),
|
||||||
fname, lnum, line);
|
fname, lnum, line);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4179,7 +4179,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
smsg(_("/ line ignored in %s line %d: %s"),
|
smsg(_("/ line ignored in %s line %ld: %s"),
|
||||||
fname, lnum, line - 1);
|
fname, lnum, line - 1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -4209,7 +4209,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
|
|||||||
l = *p - '0';
|
l = *p - '0';
|
||||||
if (l == 0 || l > spin->si_region_count)
|
if (l == 0 || l > spin->si_region_count)
|
||||||
{
|
{
|
||||||
smsg(_("Invalid region nr in %s line %d: %s"),
|
smsg(_("Invalid region nr in %s line %ld: %s"),
|
||||||
fname, lnum, p);
|
fname, lnum, p);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -4217,7 +4217,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
smsg(_("Unrecognized flags in %s line %d: %s"),
|
smsg(_("Unrecognized flags in %s line %ld: %s"),
|
||||||
fname, lnum, p);
|
fname, lnum, p);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -738,6 +738,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
436,
|
||||||
/**/
|
/**/
|
||||||
435,
|
435,
|
||||||
/**/
|
/**/
|
||||||
|
@ -1830,7 +1830,7 @@ compile_load(char_u **arg, char_u *end_arg, cctx_T *cctx, int error)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
semsg("Namespace not supported yet: %s", **arg);
|
semsg("Namespace not supported yet: %s", *arg);
|
||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2213,7 +2213,7 @@ compile_lambda_call(char_u **arg, cctx_T *cctx)
|
|||||||
if (**arg != '(')
|
if (**arg != '(')
|
||||||
{
|
{
|
||||||
if (*skipwhite(*arg) == '(')
|
if (*skipwhite(*arg) == '(')
|
||||||
semsg(_(e_nowhitespace));
|
emsg(_(e_nowhitespace));
|
||||||
else
|
else
|
||||||
semsg(_(e_missing_paren), "lambda");
|
semsg(_(e_missing_paren), "lambda");
|
||||||
clear_tv(&rettv);
|
clear_tv(&rettv);
|
||||||
|
@ -1774,14 +1774,14 @@ ex_disassemble(exarg_T *eap)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ISN_EXECUTE:
|
case ISN_EXECUTE:
|
||||||
smsg("%4d EXECUTE %d", current, iptr->isn_arg.number);
|
smsg("%4d EXECUTE %lld", current, (long long)(iptr->isn_arg.number));
|
||||||
break;
|
break;
|
||||||
case ISN_LOAD:
|
case ISN_LOAD:
|
||||||
if (iptr->isn_arg.number < 0)
|
if (iptr->isn_arg.number < 0)
|
||||||
smsg("%4d LOAD arg[%lld]", current,
|
smsg("%4d LOAD arg[%lld]", current,
|
||||||
iptr->isn_arg.number + STACK_FRAME_SIZE);
|
(long long)(iptr->isn_arg.number + STACK_FRAME_SIZE));
|
||||||
else
|
else
|
||||||
smsg("%4d LOAD $%lld", current, iptr->isn_arg.number);
|
smsg("%4d LOAD $%lld", current, (long long)(iptr->isn_arg.number));
|
||||||
break;
|
break;
|
||||||
case ISN_LOADV:
|
case ISN_LOADV:
|
||||||
smsg("%4d LOADV v:%s", current,
|
smsg("%4d LOADV v:%s", current,
|
||||||
@ -1817,15 +1817,15 @@ ex_disassemble(exarg_T *eap)
|
|||||||
smsg("%4d LOADENV %s", current, iptr->isn_arg.string);
|
smsg("%4d LOADENV %s", current, iptr->isn_arg.string);
|
||||||
break;
|
break;
|
||||||
case ISN_LOADREG:
|
case ISN_LOADREG:
|
||||||
smsg("%4d LOADREG @%c", current, iptr->isn_arg.number);
|
smsg("%4d LOADREG @%c", current, (char)(iptr->isn_arg.number));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ISN_STORE:
|
case ISN_STORE:
|
||||||
if (iptr->isn_arg.number < 0)
|
if (iptr->isn_arg.number < 0)
|
||||||
smsg("%4d STORE arg[%lld]", current,
|
smsg("%4d STORE arg[%lld]", current,
|
||||||
iptr->isn_arg.number + STACK_FRAME_SIZE);
|
(long long)(iptr->isn_arg.number + STACK_FRAME_SIZE));
|
||||||
else
|
else
|
||||||
smsg("%4d STORE $%lld", current, iptr->isn_arg.number);
|
smsg("%4d STORE $%lld", current, (long long)(iptr->isn_arg.number));
|
||||||
break;
|
break;
|
||||||
case ISN_STOREV:
|
case ISN_STOREV:
|
||||||
smsg("%4d STOREV v:%s", current,
|
smsg("%4d STOREV v:%s", current,
|
||||||
@ -1862,7 +1862,7 @@ ex_disassemble(exarg_T *eap)
|
|||||||
smsg("%4d STOREENV $%s", current, iptr->isn_arg.string);
|
smsg("%4d STOREENV $%s", current, iptr->isn_arg.string);
|
||||||
break;
|
break;
|
||||||
case ISN_STOREREG:
|
case ISN_STOREREG:
|
||||||
smsg("%4d STOREREG @%c", current, iptr->isn_arg.number);
|
smsg("%4d STOREREG @%c", current, (char)iptr->isn_arg.number);
|
||||||
break;
|
break;
|
||||||
case ISN_STORENR:
|
case ISN_STORENR:
|
||||||
smsg("%4d STORE %lld in $%d", current,
|
smsg("%4d STORE %lld in $%d", current,
|
||||||
@ -1872,7 +1872,7 @@ ex_disassemble(exarg_T *eap)
|
|||||||
|
|
||||||
// constants
|
// constants
|
||||||
case ISN_PUSHNR:
|
case ISN_PUSHNR:
|
||||||
smsg("%4d PUSHNR %lld", current, iptr->isn_arg.number);
|
smsg("%4d PUSHNR %lld", current, (long long)(iptr->isn_arg.number));
|
||||||
break;
|
break;
|
||||||
case ISN_PUSHBOOL:
|
case ISN_PUSHBOOL:
|
||||||
case ISN_PUSHSPEC:
|
case ISN_PUSHSPEC:
|
||||||
@ -1941,10 +1941,10 @@ ex_disassemble(exarg_T *eap)
|
|||||||
smsg("%4d PUSH v:exception", current);
|
smsg("%4d PUSH v:exception", current);
|
||||||
break;
|
break;
|
||||||
case ISN_NEWLIST:
|
case ISN_NEWLIST:
|
||||||
smsg("%4d NEWLIST size %lld", current, iptr->isn_arg.number);
|
smsg("%4d NEWLIST size %lld", current, (long long)(iptr->isn_arg.number));
|
||||||
break;
|
break;
|
||||||
case ISN_NEWDICT:
|
case ISN_NEWDICT:
|
||||||
smsg("%4d NEWDICT size %lld", current, iptr->isn_arg.number);
|
smsg("%4d NEWDICT size %lld", current, (long long)(iptr->isn_arg.number));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// function call
|
// function call
|
||||||
@ -2153,8 +2153,8 @@ ex_disassemble(exarg_T *eap)
|
|||||||
else
|
else
|
||||||
smsg("%4d 2BOOL (!!val)", current);
|
smsg("%4d 2BOOL (!!val)", current);
|
||||||
break;
|
break;
|
||||||
case ISN_2STRING: smsg("%4d 2STRING stack[%d]", current,
|
case ISN_2STRING: smsg("%4d 2STRING stack[%lld]", current,
|
||||||
iptr->isn_arg.number);
|
(long long)(iptr->isn_arg.number));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ISN_DROP: smsg("%4d DROP", current); break;
|
case ISN_DROP: smsg("%4d DROP", current); break;
|
||||||
|
@ -2992,7 +2992,7 @@ read_viminfo(
|
|||||||
if (p_verbose > 0)
|
if (p_verbose > 0)
|
||||||
{
|
{
|
||||||
verbose_enter();
|
verbose_enter();
|
||||||
smsg(_("Reading viminfo file \"%s\"%s%s%s"),
|
smsg(_("Reading viminfo file \"%s\"%s%s%s%s"),
|
||||||
fname,
|
fname,
|
||||||
(flags & VIF_WANT_INFO) ? _(" info") : "",
|
(flags & VIF_WANT_INFO) ? _(" info") : "",
|
||||||
(flags & VIF_WANT_MARKS) ? _(" marks") : "",
|
(flags & VIF_WANT_MARKS) ? _(" marks") : "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user