summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog6
-rw-r--r--src/scan.c8
-rw-r--r--src/skel.c10
3 files changed, 14 insertions, 10 deletions
diff --git a/debian/changelog b/debian/changelog
index 339e244..a910e72 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,8 +3,12 @@ flex (2.6.0-11) unstable; urgency=low
* Cherry pick fix from upstream.
* Bug fix: "n_alloc has wrong value in buf_append function", thanks to
Howard Gong (Closes: #761250).
+ * Bug fix: "Type of yy_n_chars changed to yy_size_t by authors cause bug
+ in YY_INPUT macro where result argument is tested if < 0; thanks to
+ gcc's -Werror=type-limits", thanks to Michal Fita (Closes:
+ #770161).
- -- Manoj Srivastava <srivasta@debian.org> Wed, 24 Feb 2016 17:15:08 -0800
+ -- Manoj Srivastava <srivasta@debian.org> Wed, 24 Feb 2016 17:43:41 -0800
flex (2.6.0-10) unstable; urgency=low
diff --git a/src/scan.c b/src/scan.c
index 0b032c2..6544737 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -210,7 +210,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- yy_size_t yy_n_chars;
+ int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -280,7 +280,7 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
-static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
yy_size_t yyleng;
/* Points to current character in buffer. */
@@ -4250,9 +4250,9 @@ static int yy_get_next_buffer (void)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
+ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
diff --git a/src/skel.c b/src/skel.c
index 26cc889..bf4c289 100644
--- a/src/skel.c
+++ b/src/skel.c
@@ -638,7 +638,7 @@ const char *skel[] = {
" /* Number of characters read into yy_ch_buf, not including EOB",
" * characters.",
" */",
- " yy_size_t yy_n_chars;",
+ " int yy_n_chars;",
"",
" /* Whether we \"own\" the buffer - i.e., we know we created it,",
" * and can realloc() it to grow it, and should free() it to",
@@ -727,7 +727,7 @@ const char *skel[] = {
"%not-for-header",
"/* yy_hold_char holds the character lost when yytext is formed. */",
"static char yy_hold_char;",
- "static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */",
+ "static int yy_n_chars; /* number of characters read into yy_ch_buf */",
"yy_size_t yyleng;",
"",
"/* Points to current character in buffer. */",
@@ -898,7 +898,7 @@ const char *skel[] = {
" size_t yy_buffer_stack_max; /**< capacity of stack. */",
" YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */",
" char yy_hold_char;",
- " yy_size_t yy_n_chars;",
+ " int yy_n_chars;",
" yy_size_t yyleng_r;",
" char *yy_c_buf_p;",
" int yy_init;",
@@ -2004,9 +2004,9 @@ const char *skel[] = {
" else",
" ret_val = EOB_ACT_CONTINUE_SCAN;",
"",
- " if ((yy_size_t) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {",
+ " if ((int) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {",
" /* Extend the array by 50%, plus the number we really need. */",
- " yy_size_t new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1);",
+ " int new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1);",
" YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(",
" (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size M4_YY_CALL_LAST_ARG );",
" if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )",