Hi All,

Compiling vim 8.0.0596 using the new gcc 7.1 (mingw) yields a few new warnings, like so:

...

gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -pipe -march=n ative -Wall -O3 -fomit-frame-pointer -freg-struct-return -s ex_docmd.c -o objnative/ex_docmd.o
In file included from ex_docmd.c:14:0:
ex_docmd.c: In function 'eval_vars':
vim.h:1584:23: warning: 'result' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define STRLEN(s)     strlen((char *)(s))
^~~~~~

...

gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -s userfunc.c -o objnative/userfunc.o
userfunc.c: In function 'get_funccal_local_ht':
userfunc.c:3575:2: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
  for (i = 0; i < debug_backtrace_level; i++)
  ^~~
userfunc.c: In function 'get_funccal_local_var':
userfunc.c:3575:2: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
  for (i = 0; i < debug_backtrace_level; i++)
  ^~~
userfunc.c: In function 'get_funccal_args_ht':
userfunc.c:3575:2: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
  for (i = 0; i < debug_backtrace_level; i++)
  ^~~
userfunc.c: In function 'get_funccal_args_var':
userfunc.c:3575:2: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
  for (i = 0; i < debug_backtrace_level; i++)
  ^~~

...

The attached patch appears to resolve the one about strlen(), but I am not sure about the others.


Cheers

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 [email protected].
For more options, visit https://groups.google.com/d/optout.
--- ex_docmd.c.orig     2017-04-21 05:57:12.939565700 +1000
+++ ex_docmd.c  2017-05-05 13:25:15.770532000 +1000
@@ -10890,6 +10890,9 @@
                result = strbuf;
                break;
 #endif
+       default:
+           result = (char_u *)"";
+           break;
        }
 
        resultlen = (int)STRLEN(result);        /* length of new string */

Raspunde prin e-mail lui