summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-03-23 22:12:22 +0100
committerBram Moolenaar <Bram@vim.org>2020-03-23 22:12:22 +0100
commitdb99f9f29a248b84742b6779c3343123f72065e7 (patch)
treee0f89d9f7c7b5c44e3d5abbde004ae814b11688e
parentdbbb0ef729e392e313ccc63c247bff1b828a214d (diff)
patch 8.2.0436: no warnings for incorrect printf argumentsv8.2.0436
Problem: No warnings for incorrect printf arguments. Solution: Fix attribute in declaration. Fix uncovered mistakes. (Dominique Pelle, closes #5834)
-rw-r--r--src/eval.c4
-rw-r--r--src/gui.c2
-rw-r--r--src/ops.c2
-rw-r--r--src/proto.h6
-rw-r--r--src/spellfile.c16
-rw-r--r--src/version.c2
-rw-r--r--src/vim9compile.c4
-rw-r--r--src/vim9execute.c24
-rw-r--r--src/viminfo.c2
9 files changed, 32 insertions, 30 deletions
diff --git a/src/eval.c b/src/eval.c
index 415ed5a9d3..975afe577c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2848,7 +2848,7 @@ eval_lambda(
if (verbose)
{
if (*skipwhite(*arg) == '(')
- semsg(_(e_nowhitespace));
+ emsg(_(e_nowhitespace));
else
semsg(_(e_missing_paren), "lambda");
}
@@ -2910,7 +2910,7 @@ eval_method(
else if (VIM_ISWHITE((*arg)[-1]))
{
if (verbose)
- semsg(_(e_nowhitespace));
+ emsg(_(e_nowhitespace));
ret = FAIL;
}
else
diff --git a/src/gui.c b/src/gui.c
index 4733bad6e4..0e008c12d8 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -542,7 +542,7 @@ gui_init(void)
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
{
diff --git a/src/ops.c b/src/ops.c
index 08209c7c6f..eaeb0f7959 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -2999,7 +2999,7 @@ op_addsub(
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);
}
}
diff --git a/src/proto.h b/src/proto.h
index a8faa83ca5..74f38cd036 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -119,7 +119,7 @@ extern int _stricoll(char *a, char *b);
// 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
;
@@ -138,14 +138,14 @@ int smsg_attr_keep(int, const char *, ...)
// 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
;
diff --git a/src/spellfile.c b/src/spellfile.c
index c3e53b330b..9500813e08 100644
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -4115,7 +4115,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
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;
}
@@ -4133,10 +4133,10 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
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
{
@@ -4159,13 +4159,13 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
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
{
@@ -4179,7 +4179,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
continue;
}
- smsg(_("/ line ignored in %s line %d: %s"),
+ smsg(_("/ line ignored in %s line %ld: %s"),
fname, lnum, line - 1);
continue;
}
@@ -4209,7 +4209,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
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;
}
@@ -4217,7 +4217,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
}
else
{
- smsg(_("Unrecognized flags in %s line %d: %s"),
+ smsg(_("Unrecognized flags in %s line %ld: %s"),
fname, lnum, p);
break;
}
diff --git a/src/version.c b/src/version.c
index 738f31b3c5..17e309570e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 436,
+/**/
435,
/**/
434,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index f768fc75e9..a595580dbe 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1830,7 +1830,7 @@ compile_load(char_u **arg, char_u *end_arg, cctx_T *cctx, int error)
}
else
{
- semsg("Namespace not supported yet: %s", **arg);
+ semsg("Namespace not supported yet: %s", *arg);
goto theend;
}
}
@@ -2213,7 +2213,7 @@ compile_lambda_call(char_u **arg, cctx_T *cctx)
if (**arg != '(')
{
if (*skipwhite(*arg) == '(')
- semsg(_(e_nowhitespace));
+ emsg(_(e_nowhitespace));
else
semsg(_(e_missing_paren), "lambda");
clear_tv(&rettv);
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 9f829d69fb..a5b707492d 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -1774,14 +1774,14 @@ ex_disassemble(exarg_T *eap)
}
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,
@@ -1817,15 +1817,15 @@ ex_disassemble(exarg_T *eap)
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,
@@ -1862,7 +1862,7 @@ ex_disassemble(exarg_T *eap)
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,
@@ -1872,7 +1872,7 @@ ex_disassemble(exarg_T *eap)
// 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:
@@ -1941,10 +1941,10 @@ ex_disassemble(exarg_T *eap)
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
@@ -2153,8 +2153,8 @@ ex_disassemble(exarg_T *eap)
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;
diff --git a/src/viminfo.c b/src/viminfo.c
index 897e864629..c1339f08c6 100644
--- a/src/viminfo.c
+++ b/src/viminfo.c
@@ -2992,7 +2992,7 @@ read_viminfo(
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") : "",