flex/flex-yybytes_len.patch
Arjun Shankar 967afaa6d0 Remove g++ signed/unsigned comparison warning in generated scanner
Compiling a flex generated scanner with g++ with all warnings turned on (-Wall)
produces a warning due to "comparison of integer expressions of different
signedness". This change removes the warning by using the same signedness.

This bug was a regression inherited from upstream flex during the rebase to
flex-2.6.1. The same bug was fixed previously (albeit differently) by commit
a3088c99e8.
2018-06-28 16:18:04 +02:00

25 lines
763 B
Diff

commit cf4121fa97abac8aeaa5e08b8fc0b2380228494e
Author: rlar <rlar>
Date: Sat Feb 27 22:46:02 2016 +0100
generated code, `_yybytes_len' is of type `int', fix code accordingly
Index: b/src/flex.skl
===================================================================
--- a/src/flex.skl
+++ b/src/flex.skl
@@ -2451,11 +2451,11 @@ YY_BUFFER_STATE yy_scan_bytes YYFARGS2(
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- yy_size_t i;
+ int i;
m4_dnl M4_YY_DECL_GUTS_VAR();
/* Get memory for full buffer, including space for trailing EOB's. */
- n = (yy_size_t) _yybytes_len + 2;
+ n = (yy_size_t) (_yybytes_len + 2);
buf = (char *) yyalloc( n M4_YY_CALL_LAST_ARG );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );