Problem: No warnings for incorrect printf arguments.
Solution: Fix attribute in declaration. Fix uncovered mistakes. (Dominique
Pelle, closes #5834)
if (verbose)
{
if (*skipwhite(*arg) == '(')
- semsg(_(e_nowhitespace));
+ emsg(_(e_nowhitespace));
else
semsg(_(e_missing_paren), "lambda");
}
else if (VIM_ISWHITE((*arg)[-1]))
{
if (verbose)
- semsg(_(e_nowhitespace));
+ emsg(_(e_nowhitespace));
ret = FAIL;
}
else
if (STRCMP(use_gvimrc, "NONE") != 0
&& STRCMP(use_gvimrc, "NORC") != 0
&& 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
{
curbuf->b_op_start = startpos;
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);
}
}
// These prototypes cannot be produced automatically.
int smsg(const char *, ...)
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
- __attribute__((format(printf, 1, 0)))
+ __attribute__((format(printf, 1, 2)))
# endif
;
// These prototypes cannot be produced automatically.
int semsg(const char *, ...)
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
- __attribute__((format(printf, 1, 0)))
+ __attribute__((format(printf, 1, 2)))
# endif
;
// These prototypes cannot be produced automatically.
void siemsg(const char *, ...)
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
- __attribute__((format(printf, 1, 0)))
+ __attribute__((format(printf, 1, 2)))
# endif
;
pc = string_convert(&spin->si_conv, rline, 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);
continue;
}
if (STRNCMP(line, "encoding=", 9) == 0)
{
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);
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);
else
{
if (STRNCMP(line, "regions=", 8) == 0)
{
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);
else
{
line += 8;
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);
else
{
continue;
}
- smsg(_("/ line ignored in %s line %d: %s"),
+ smsg(_("/ line ignored in %s line %ld: %s"),
fname, lnum, line - 1);
continue;
}
l = *p - '0';
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);
break;
}
}
else
{
- smsg(_("Unrecognized flags in %s line %d: %s"),
+ smsg(_("Unrecognized flags in %s line %ld: %s"),
fname, lnum, p);
break;
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 436,
/**/
435,
/**/
}
else
{
- semsg("Namespace not supported yet: %s", **arg);
+ semsg("Namespace not supported yet: %s", *arg);
goto theend;
}
}
if (**arg != '(')
{
if (*skipwhite(*arg) == '(')
- semsg(_(e_nowhitespace));
+ emsg(_(e_nowhitespace));
else
semsg(_(e_missing_paren), "lambda");
clear_tv(&rettv);
}
break;
case ISN_EXECUTE:
- smsg("%4d EXECUTE %d", current, iptr->isn_arg.number);
+ smsg("%4d EXECUTE %lld", current, (long long)(iptr->isn_arg.number));
break;
case ISN_LOAD:
if (iptr->isn_arg.number < 0)
smsg("%4d LOAD arg[%lld]", current,
- iptr->isn_arg.number + STACK_FRAME_SIZE);
+ (long long)(iptr->isn_arg.number + STACK_FRAME_SIZE));
else
- smsg("%4d LOAD $%lld", current, iptr->isn_arg.number);
+ smsg("%4d LOAD $%lld", current, (long long)(iptr->isn_arg.number));
break;
case ISN_LOADV:
smsg("%4d LOADV v:%s", current,
smsg("%4d LOADENV %s", current, iptr->isn_arg.string);
break;
case ISN_LOADREG:
- smsg("%4d LOADREG @%c", current, iptr->isn_arg.number);
+ smsg("%4d LOADREG @%c", current, (char)(iptr->isn_arg.number));
break;
case ISN_STORE:
if (iptr->isn_arg.number < 0)
smsg("%4d STORE arg[%lld]", current,
- iptr->isn_arg.number + STACK_FRAME_SIZE);
+ (long long)(iptr->isn_arg.number + STACK_FRAME_SIZE));
else
- smsg("%4d STORE $%lld", current, iptr->isn_arg.number);
+ smsg("%4d STORE $%lld", current, (long long)(iptr->isn_arg.number));
break;
case ISN_STOREV:
smsg("%4d STOREV v:%s", current,
smsg("%4d STOREENV $%s", current, iptr->isn_arg.string);
break;
case ISN_STOREREG:
- smsg("%4d STOREREG @%c", current, iptr->isn_arg.number);
+ smsg("%4d STOREREG @%c", current, (char)iptr->isn_arg.number);
break;
case ISN_STORENR:
smsg("%4d STORE %lld in $%d", current,
// constants
case ISN_PUSHNR:
- smsg("%4d PUSHNR %lld", current, iptr->isn_arg.number);
+ smsg("%4d PUSHNR %lld", current, (long long)(iptr->isn_arg.number));
break;
case ISN_PUSHBOOL:
case ISN_PUSHSPEC:
smsg("%4d PUSH v:exception", current);
break;
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;
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;
// function call
else
smsg("%4d 2BOOL (!!val)", current);
break;
- case ISN_2STRING: smsg("%4d 2STRING stack[%d]", current,
- iptr->isn_arg.number);
+ case ISN_2STRING: smsg("%4d 2STRING stack[%lld]", current,
+ (long long)(iptr->isn_arg.number));
break;
case ISN_DROP: smsg("%4d DROP", current); break;
if (p_verbose > 0)
{
verbose_enter();
- smsg(_("Reading viminfo file \"%s\"%s%s%s"),
+ smsg(_("Reading viminfo file \"%s\"%s%s%s%s"),
fname,
(flags & VIF_WANT_INFO) ? _(" info") : "",
(flags & VIF_WANT_MARKS) ? _(" marks") : "",