# HG changeset patch # User Bram Moolenaar # Date 1378649227 -7200 # Node ID 6bbb2ae990c92f6858b86c047e16dd12183d4273 # Parent 3530261cb77b9c642e5d7191c42cbb27f1b9714c 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 --- 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 --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 26, +/**/ 25, /**/ 24,