Package: sqlite / 2.8.17-15

08-fix_unsigned_FTBFS.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Fix FTBFS with GCC 7/8 on architectures with unsigned char
 In some cases, hash ends up with a negative value, causing the crash.
 Starting with GCC 7, the & 0x7fffffff is optimized out on architectures
 which have an unsigned char. stddt is defined as a char, and hash as a
 (signed) int. Integer wraparound (overflow) is not defined by the C
 standard, so GCC is allowed to optimize out the bitwise operation if
 sddt is unsigned.
Author: Aurelien Jarno <aurelien@aurel32.net>
Bug-Debian: https://bugs.debian.org/872535
Last-Update: 2018-04-23

---

--- sqlite-2.8.17.orig/tool/lemon.c
+++ sqlite-2.8.17/tool/lemon.c
@@ -3018,7 +3018,7 @@ int mhflag;                 /* True if g
   int maxdtlength;          /* Maximum length of any ".datatype" field. */
   char *stddt;              /* Standardized name for a datatype */
   int i,j;                  /* Loop counters */
-  int hash;                 /* For hashing the name of a type */
+  unsigned int hash;        /* For hashing the name of a type */
   char *name;               /* Name of the parser */
 
   /* Allocate and initialize types[] and allocate stddt[] */