diff --git a/flex-yyleng.patch b/flex-yyleng.patch new file mode 100644 index 0000000..6faa709 --- /dev/null +++ b/flex-yyleng.patch @@ -0,0 +1,116 @@ +Index: flex-2.5.37/gen.c +=================================================================== +--- flex-2.5.37.orig/gen.c ++++ flex-2.5.37/gen.c +@@ -1516,11 +1516,11 @@ void make_tables () + if (yymore_used && !yytext_is_array) { + indent_puts ("YY_G(yytext_ptr) -= YY_G(yy_more_len); \\"); + indent_puts +- ("yyleng = (size_t) (yy_cp - YY_G(yytext_ptr)); \\"); ++ ("yyleng = (int) (yy_cp - YY_G(yytext_ptr)); \\"); + } + + else +- indent_puts ("yyleng = (size_t) (yy_cp - yy_bp); \\"); ++ indent_puts ("yyleng = (int) (yy_cp - yy_bp); \\"); + + /* Now also deal with copying yytext_ptr to yytext if needed. */ + skelout (); /* %% [3.0] - break point in skel */ +Index: flex-2.5.37/scan.c +=================================================================== +--- flex-2.5.37.orig/scan.c ++++ flex-2.5.37/scan.c +@@ -158,7 +158,7 @@ typedef struct yy_buffer_state *YY_BUFFE + typedef size_t yy_size_t; + #endif + +-extern yy_size_t yyleng; ++extern int yyleng; + + extern FILE *yyin, *yyout; + +@@ -272,7 +272,7 @@ static YY_BUFFER_STATE * yy_buffer_stack + /* 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 */ +-yy_size_t yyleng; ++int yyleng; + + /* Points to current character in buffer. */ + static char *yy_c_buf_p = (char *) 0; +@@ -356,7 +356,7 @@ static void yy_fatal_error (yyconst char + #define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + (yytext_ptr) -= (yy_more_len); \ +- yyleng = (size_t) (yy_cp - (yytext_ptr)); \ ++ yyleng = (int) (yy_cp - (yytext_ptr)); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; +@@ -2036,7 +2036,7 @@ FILE *yyget_out (void ); + + void yyset_out (FILE * out_str ); + +-yy_size_t yyget_leng (void ); ++int yyget_leng (void ); + + char *yyget_text (void ); + +@@ -4968,7 +4968,7 @@ FILE *yyget_out (void) + /** Get the length of the current token. + * + */ +-yy_size_t yyget_leng (void) ++int yyget_leng (void) + { + return yyleng; + } +Index: flex-2.5.37/skel.c +=================================================================== +--- flex-2.5.37.orig/skel.c ++++ flex-2.5.37/skel.c +@@ -536,7 +536,7 @@ const char *skel[] = { + "#endif", + "", + "%if-not-reentrant", +- "extern yy_size_t yyleng;", ++ "extern int yyleng;", + "%endif", + "", + "%if-c-only", +@@ -712,7 +712,7 @@ const char *skel[] = { + "/* 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 */", +- "yy_size_t yyleng;", ++ "int yyleng;", + "", + "/* Points to current character in buffer. */", + "static char *yy_c_buf_p = (char *) 0;", +@@ -875,7 +875,7 @@ const char *skel[] = { + " YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */", + " char yy_hold_char;", + " yy_size_t yy_n_chars;", +- " yy_size_t yyleng_r;", ++ " int yyleng_r;", + " char *yy_c_buf_p;", + " int yy_init;", + " int yy_start;", +@@ -1012,7 +1012,7 @@ const char *skel[] = { + "", + "m4_ifdef( [[M4_YY_NO_GET_LENG]],,", + "[[", +- "yy_size_t yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", ++ "int yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", + "]])", + "", + "m4_ifdef( [[M4_YY_NO_GET_TEXT]],,", +@@ -2792,7 +2792,7 @@ const char *skel[] = { + "/** Get the length of the current token.", + " * M4_YY_DOC_PARAM", + " */", +- "yy_size_t yyget_leng YYFARGS0(void)", ++ "int yyget_leng YYFARGS0(void)", + "{", + " M4_YY_DECL_GUTS_VAR();", + " return yyleng;", diff --git a/flex.changes b/flex.changes index fa5c0ab..12262f1 100644 --- a/flex.changes +++ b/flex.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Feb 15 17:45:41 UTC 2015 - schwab@linux-m68k.org + +- flex-yyleng.patch: fix type of yyleng to be int as mandated by POSIX. + Fixes perl-SystemPerl, for example. + ------------------------------------------------------------------- Mon Jan 5 11:35:08 UTC 2015 - mlin@suse.com diff --git a/flex.spec b/flex.spec index 90cb9a4..f7e0ee5 100644 --- a/flex.spec +++ b/flex.spec @@ -47,6 +47,8 @@ Patch3: http://www.linuxfromscratch.org/patches/lfs/7.2/flex-2.5.37-biso # PATCH-FIX-UPSTREAM flex-2.5.37-bison3.patch mlin@suse.com - fix tests for bison3 Patch4: flex-compatible-with-bison3.patch Patch5: config-guess-sub-update.patch +# PATCH-FIX-UPSTREAM fix type of yyleng as mandated by POSIX (flex bug #187) +Patch6: flex-yyleng.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -60,6 +62,7 @@ patterns in text. %patch3 -p1 %patch4 -p1 %patch5 +%patch6 -p1 %build autoreconf -fi