Hi
Compiling vim-7.3.462 with gcc-4.7.0 20120213 (experimental),
gives the following compilation warning:
version.c:2189:14: warning: array subscript is above array bounds
[-Warray-bounds]
Warning looks scary but in this case it is harmless.
Attached patch changes the code to avoid the warning.
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
diff -r f1f6ac67acd8 src/version.c
--- a/src/version.c Wed Feb 29 19:20:03 2012 +0100
+++ b/src/version.c Sat Mar 03 22:08:57 2012 +0100
@@ -2161,6 +2161,7 @@
int col;
char_u *p;
int l;
+ int len;
int clen;
#ifdef MODIFIED_BY
# define MODBY_LEN 150
@@ -2185,12 +2186,9 @@
/* Check for 9.9x or 9.9xx, alpha/beta version */
if (isalpha((int)vers[3]))
{
- if (isalpha((int)vers[4]))
- sprintf((char *)vers + 5, ".%d%s", highest_patch(),
- mediumVersion + 5);
- else
- sprintf((char *)vers + 4, ".%d%s", highest_patch(),
- mediumVersion + 4);
+ len = (isalpha((int)vers[4])) ? 5 : 4;
+ sprintf((char *)vers + len, ".%d%s", highest_patch(),
+ mediumVersion + len);
}
else
sprintf((char *)vers + 3, ".%d", highest_patch());