John Marriott wrote:
> 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.
Thanks. The others smell like a compiler bug. Signed overflow can't
happen because of the condition.
--
You can be stopped by the police for biking over 65 miles per hour.
You are not allowed to walk across a street on your hands.
[real standing laws in Connecticut, United States of America]
/// Bram Moolenaar -- [email protected] -- 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 [email protected].
For more options, visit https://groups.google.com/d/optout.