From: Bram Moolenaar Date: Sun, 8 Sep 2013 14:07:07 +0000 (+0200) Subject: updated for version 7.4.026 X-Git-Tag: v7.4.026 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95235e64d8329b8c0fbd9311d98626afe86ad911;p=vim updated for version 7.4.026 Problem: Clang warning for int shift overflow. Solution: Use unsigned and cast back to int. (Dominique Pelle) --- diff --git a/src/misc2.c b/src/misc2.c index 504cf0aed..b8655e84a 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -6496,13 +6496,15 @@ get3c(fd) get4c(fd) FILE *fd; { - int n; - - n = getc(fd); - n = (n << 8) + getc(fd); - n = (n << 8) + getc(fd); - n = (n << 8) + getc(fd); - return n; + /* Use unsigned rather than int otherwise result is undefined + * when left-shift sets the MSB. */ + unsigned n; + + n = (unsigned)getc(fd); + n = (n << 8) + (unsigned)getc(fd); + n = (n << 8) + (unsigned)getc(fd); + n = (n << 8) + (unsigned)getc(fd); + return (int)n; } /* diff --git a/src/version.c b/src/version.c index ff4e3bb6f..f875d013d 100644 --- a/src/version.c +++ b/src/version.c @@ -738,6 +738,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 26, /**/ 25, /**/