Bram Moolenaar <[email protected]> wrote: > Axel Bender wrote: > >> Windows 7 64-bit, MinGw 64 >> >> >> >>>CONSOLE<<< >> >> gcc -c -Iproto -DWIN32 -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -DHAVE_PATHDEF >> -DFEAT_BIG -DMS_WIN64 -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT >> -DFEAT_CSCOPE -DFEAT_CHANNEL -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME >> -DDYNAMIC_ICONV -pipe -march=x86-64 -Wall -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 >> -DDYNAMIC_PYTHON3_DLL=\"python32.dll\" -O3 -fomit-frame-pointer >> -freg-struct-return -s getchar.c -o objx86-64/getchar.o >> >> getchar.c: In function 'check_map': >> getchar.c:5212:7: warning: assuming signed overflow does not occur when >> assuming that (X - c) <= X is always true [-Wstrict-overflow] >> if (len > mp->m_keylen - 3) >> ^ >> >> >>>GUI<<< >> >> gcc -c -Iproto -DWIN32 -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 -DHAVE_PATHDEF >> -DFEAT_BIG -DMS_WIN64 -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT >> -DFEAT_CSCOPE -DFEAT_CHANNEL -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_MBYTE >> -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -march=x86-64 -Wall >> -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python32.dll\" >> -DFEAT_XPM_W32 -I xpm/x64/include -I xpm/x64/../include -O3 >> -fomit-frame-pointer -freg-struct-return -s getchar.c -o gobjx86-64/getchar.o >> >> getchar.c: In function 'check_map': >> getchar.c:5212:7: warning: assuming signed overflow does not occur when >> assuming that (X - c) <= X is always true [-Wstrict-overflow] >> if (len > mp->m_keylen - 3) >> ^ > > This was mentioned before. There is nothing wrong with this code. I > rather blame the compiler. I also don't see a good way to avoid the > warning. Someone suggested casting to unsigned, but that actually > breaks it.
I was not thrilled about the unsigned cast, but how did it break it? if ((unsigned)len > (unsigned)mp->m_keylen - 3U) Even if m_keylen was say 2, then it would behave as without the cast, as it would compare len with a very big number. I think it works, but does not win a beauty price. Regards Dominique -- -- 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.
