Package: flex / 2.5.39-8+deb8u2

0007-generated-code-max_size-seems-to-be-of-type-int-fix-.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Description: generated code, `max_size' seems to be of type `int', fix casts accordingly
Origin: backport, https://github.com/westes/flex/commit/3946924ed5e77420c453bf841603c7278766093a
Bug-Debian: https://bugs.debian.org/835542
Forwarded: not-needed
Author: rlar <rlar>
Author: Salvatore Bonaccorso <carnil@debian.org>
Last-Update: 2016-08-31

---
 src/gen.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/gen.c
+++ b/gen.c
@@ -1874,7 +1874,7 @@ void make_tables ()
 	if (!C_plus_plus) {
 		if (use_read) {
 			outn ("\terrno=0; \\");
-			outn ("\twhile ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \\");
+			outn ("\twhile ( (result = read( fileno(yyin), (char *) buf, (yy_size_t) max_size )) < 0 ) \\");
 			outn ("\t{ \\");
 			outn ("\t\tif( errno != EINTR) \\");
 			outn ("\t\t{ \\");
@@ -1890,7 +1890,7 @@ void make_tables ()
 			outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\");
 			outn ("\t\t{ \\");
 			outn ("\t\tint c = '*'; \\");
-			outn ("\t\tsize_t n; \\");
+			outn ("\t\tint n; \\");
 			outn ("\t\tfor ( n = 0; n < max_size && \\");
 			outn ("\t\t\t     (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\");
 			outn ("\t\t\tbuf[n] = (char) c; \\");
@@ -1903,7 +1903,7 @@ void make_tables ()
 			outn ("\telse \\");
 			outn ("\t\t{ \\");
 			outn ("\t\terrno=0; \\");
-			outn ("\t\twhile ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \\");
+			outn ("\t\twhile ( (result = fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \\");
 			outn ("\t\t\t{ \\");
 			outn ("\t\t\tif( errno != EINTR) \\");
 			outn ("\t\t\t\t{ \\");