Re: Patch 8.0.1677

2018-04-11 Fir de Conversatie John Marriott


On 10-Apr.-2018 20:42, Bram Moolenaar wrote:

John Marriott wrote:


On 08-Apr.-2018 21:08, Bram Moolenaar wrote:

Patch 8.0.1677
Problem:No compiler warning for wrong format in vim_snprintf().
Solution:   Add printf attribute for gcc.  Fix reported problems.
Files:  src/vim.h, src/proto.h, src/eval.c, src/fileio.c, src/mbyte.c,
  src/ops.c, src/spellfile.c, src/undo.c, src/json.c



After this patch (and 8.0.1679 as well) mingw (32 and 64 bit) throws
these warnings:

Hmm, looks like the attribute isn't implemented correctly for MinGW.
I'll change the #ifdef to exclude it there.



Hi Bram,

Patch 1681 fixes it for me.

Thanks
John

--
--
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.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.0.1677

2018-04-10 Fir de Conversatie Bram Moolenaar

John Marriott wrote:

> On 08-Apr.-2018 21:08, Bram Moolenaar wrote:
> > Patch 8.0.1677
> > Problem:No compiler warning for wrong format in vim_snprintf().
> > Solution:   Add printf attribute for gcc.  Fix reported problems.
> > Files:  src/vim.h, src/proto.h, src/eval.c, src/fileio.c, src/mbyte.c,
> >  src/ops.c, src/spellfile.c, src/undo.c, src/json.c
> >
> >
> After this patch (and 8.0.1679 as well) mingw (32 and 64 bit) throws 
> these warnings:

Hmm, looks like the attribute isn't implemented correctly for MinGW.
I'll change the #ifdef to exclude it there.


-- 
hundred-and-one symptoms of being an internet addict:
139. You down your lunch in five minutes, at your desk, so you can
 spend the rest of the hour surfing the Net.

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.0.1677

2018-04-09 Fir de Conversatie John Marriott


On 08-Apr.-2018 21:08, Bram Moolenaar wrote:

Patch 8.0.1677
Problem:No compiler warning for wrong format in vim_snprintf().
Solution:   Add printf attribute for gcc.  Fix reported problems.
Files:  src/vim.h, src/proto.h, src/eval.c, src/fileio.c, src/mbyte.c,
 src/ops.c, src/spellfile.c, src/undo.c, src/json.c


After this patch (and 8.0.1679 as well) mingw (32 and 64 bit) throws 
these warnings:



gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF 
-DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_DIRECTX
 -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DFEAT_GUI_W32 -DFEAT_CLIPBOARD 
-DFEAT_MBYTE -pipe -march=native -Wall
 -fomit-frame-pointer -freg-struct-return -s eval.c -o gobjnative/eval.o
eval.c: In function 'get_tv_string_buf_chk':
eval.c:7107:46: warning: unknown conversion type character 'l' in format 
[-Wformat=]
  vim_snprintf((char *)buf, NUMBUFLEN, "%lld",
  ^
eval.c:7107:43: warning: too many arguments for format [-Wformat-extra-args]
  vim_snprintf((char *)buf, NUMBUFLEN, "%lld",
   ^~

...
gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF 
-DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_DIRECTX
 -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DFEAT_GUI_W32 -DFEAT_CLIPBOARD 
-DFEAT_MBYTE -pipe -march=native -Wall
 -fomit-frame-pointer -freg-struct-return -s fileio.c -o gobjnative/fileio.o
fileio.c: In function 'msg_add_lines':
fileio.c:5318:12: warning: unknown conversion type character 'l' in format 
[-Wformat=]
   "%ldL, %lldC", lnum, (long long)nchars);
^
fileio.c:5318:3: warning: too many arguments for format [-Wformat-extra-args]
   "%ldL, %lldC", lnum, (long long)nchars);
   ^
In file included from fileio.c:14:0:
vim.h:581:24: warning: unknown conversion type character 'l' in format 
[-Wformat=]
 # define _(x) ((char *)(x))
^
fileio.c:5330:7: note: in expansion of macro '_'
   _("%lld characters"), (long long)nchars);
   ^
vim.h:581:24: warning: too many arguments for format [-Wformat-extra-args]
 # define _(x) ((char *)(x))
^
fileio.c:5330:7: note: in expansion of macro '_'
   _("%lld characters"), (long long)nchars);
   ^

...
gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF 
-DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_DIRECTX
 -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DFEAT_GUI_W32 -DFEAT_CLIPBOARD 
-DFEAT_MBYTE -pipe -march=native -Wall
 -fomit-frame-pointer -freg-struct-return -s json.c -o gobjnative/json.o
json.c: In function 'json_encode_item':
json.c:219:49: warning: unknown conversion type character 'l' in format 
[-Wformat=]
  vim_snprintf((char *)numbuf, NUMBUFLEN, "%lld",
 ^
json.c:219:46: warning: too many arguments for format [-Wformat-extra-args]
  vim_snprintf((char *)numbuf, NUMBUFLEN, "%lld",
  ^~

...
gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF 
-DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_DIRECTX
 -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DFEAT_GUI_W32 -DFEAT_CLIPBOARD 
-DFEAT_MBYTE -pipe -march=native -Wall
 -fomit-frame-pointer -freg-struct-return -s ops.c -o gobjnative/ops.o
ops.c: In function 'do_addsub':
ops.c:5979:47: warning: unknown conversion type character 'l' in format 
[-Wformat=]
  vim_snprintf((char *)buf2, NUMBUFLEN, "%llu",
   ^
ops.c:5979:44: warning: too many arguments for format [-Wformat-extra-args]
  vim_snprintf((char *)buf2, NUMBUFLEN, "%llu",
^~
ops.c:5982:47: warning: unknown conversion type character 'l' in format 
[-Wformat=]
  vim_snprintf((char *)buf2, NUMBUFLEN, "%llo",
   ^
ops.c:5982:44: warning: too many arguments for format [-Wformat-extra-args]
  vim_snprintf((char *)buf2, NUMBUFLEN, "%llo",
^~
ops.c:5985:47: warning: unknown conversion type character 'l' in format 
[-Wformat=]
  vim_snprintf((char *)buf2, NUMBUFLEN, "%llX",
   ^
ops.c:5985:44: warning: too many arguments for format [-Wformat-extra-args]
  vim_snprintf((char *)buf2, NUMBUFLEN, "%llX",
^~
ops.c:5988:47: warning: unknown conversion type character 'l' in format 
[-Wformat=]
  vim_snprintf((char *)buf2, NUMBUFLEN, "%llx",
   ^
ops.c:5988:44: warning: too many arguments for format [-Wformat-extra-args]
  vim_snprintf((char *)buf2, NUMBUFLEN, "%llx",
^~
In file included from ops.c:15:0:
ops.c: In function 'cursor_pos_info':
vim.h:581:24: warning: unknown conversion type character 'l' in format