diff options
-rw-r--r-- | debian/NEWS.Debian | 10 | ||||
-rw-r--r-- | debian/changelog | 29 | ||||
-rw-r--r-- | debian/control | 7 | ||||
-rw-r--r-- | src/flex.skl | 10 | ||||
-rw-r--r-- | src/gen.c | 2 | ||||
-rw-r--r-- | src/main.c | 26 | ||||
-rw-r--r-- | src/skel.c | 70 |
7 files changed, 96 insertions, 58 deletions
diff --git a/debian/NEWS.Debian b/debian/NEWS.Debian index cd82bd8..6e9492b 100644 --- a/debian/NEWS.Debian +++ b/debian/NEWS.Debian @@ -1,3 +1,13 @@ +flex (2.6.1-1.1) unstable; urgency=medium + + In this upload, the flex package drops its dependency on libfl-dev, because + it is impossible to forward the correct architecture constraint. It contains + the FlexLexer.h header and is thus required for using the FlexLexer C++ + interface. Packages using this library need to add libfl-dev to their + Build-Depends. + + -- Helmut Grohne <helmut@subdivi.de> Wed, 23 Nov 2016 13:18:32 +0100 + flex (2.5.33-7) unstable; urgency=low This version of Flex is a major upgrade from previous versions. There diff --git a/debian/changelog b/debian/changelog index 77442d7..e158dc6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,32 @@ +flex (2.6.1-1.3) unstable; urgency=medium + + * Non-maintainer upload. + * Fix FTBFS on hurd (upstream 7975c43384d766ca12cb3f292754dbdc34168886). + (Closes: 838133). + + -- Christoph Berg <myon@debian.org> Wed, 04 Jan 2017 19:53:51 +0100 + +flex (2.6.1-1.2) unstable; urgency=medium + + * Non-maintainer upload. + * Cherry-pick 1da19feba7c957e0f0af0c3eeadc29e8c82b0ca3, + cf4121fa97abac8aeaa5e08b8fc0b2380228494e and + 8c098febc9a599397921e9b6938b7fb85e38cc7e from upstream to fix comparison + between signed and unsigned integer expressions in generated lexer + (Closes: #835542). + * Fix distribution in last upload's NEWS.Debian. + + -- Christoph Berg <myon@debian.org> Fri, 30 Dec 2016 20:29:41 +0100 + +flex (2.6.1-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Demote flex dependency on libfl-dev to Recommends. + * Have libfl-dev depend on flex to enforce the same-version constraint. + * Annotate flex Multi-Arch: foreign again (Closes: #840080). + + -- Helmut Grohne <helmut@subdivi.de> Thu, 24 Nov 2016 07:34:27 +0100 + flex (2.6.1-1) unstable; urgency=low * New upstream version. The development of flex ias transitionaing to diff --git a/debian/control b/debian/control index 049ed21..354f33e 100644 --- a/debian/control +++ b/debian/control @@ -14,10 +14,11 @@ Standards-Version: 3.9.8 Package: flex Architecture: any Pre-Depends: debconf | debconf-2.0 -Depends: ${shlibs:Depends}, m4, libfl-dev (= ${binary:Version}), +Depends: ${shlibs:Depends}, m4, dpkg (>= 1.15.4) | install-info, ${misc:Depends} -Recommends: gcc | c-compiler +Recommends: gcc | c-compiler, libfl-dev Suggests: bison, build-essential +Multi-Arch: foreign Description: fast lexical analyzer generator Flex is a tool for generating scanners: programs which recognized lexical patterns in text. It reads the given input files for a description of a @@ -48,7 +49,7 @@ Package: libfl-dev Section: libdevel Architecture: any Multi-Arch: same -Depends: ${misc:Depends}, ${shlibs:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, flex (= ${binary:Version}) Replaces: flex (<< 2.5.39), flex-old (<= 2.5.4a-10) Breaks: flex (<< 2.5.39), flex-old (<= 2.5.4a-10) Description: static library for flex (a fast lexical analyzer generator) diff --git a/src/flex.skl b/src/flex.skl index d85e729..b638248 100644 --- a/src/flex.skl +++ b/src/flex.skl @@ -1661,7 +1661,7 @@ int yyFlexLexer::yy_get_next_buffer() M4_YY_DECL_GUTS_VAR(); char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = YY_G(yytext_ptr); - yy_size_t number_to_move, i; + int number_to_move, i; int ret_val; if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] ) @@ -1690,7 +1690,7 @@ int yyFlexLexer::yy_get_next_buffer() /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (yy_size_t) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr)) - 1; + number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - 1); for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1778,7 +1778,7 @@ m4_ifdef( [[M4_YY_USES_REJECT]], else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((int) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((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. */ 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( @@ -2451,11 +2451,11 @@ YY_BUFFER_STATE yy_scan_bytes YYFARGS2( yyconst char *,yybytes, int ,_yybytes_l 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()" ); @@ -1973,7 +1973,7 @@ void make_tables (void) ("if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )"); ++indent_level; indent_puts ("{"); - indent_puts ("yy_size_t yyl;"); + indent_puts ("int yyl;"); do_indent (); out_str ("for ( yyl = %s; yyl < yyleng; ++yyl )\n", yymore_used ? (yytext_is_array ? "YY_G(yy_prev_more_offset)" : @@ -358,8 +358,8 @@ void check_options (void) if (!path) { m4 = M4; } else { + int m4_length = strlen(m4); do { - char m4_path[PATH_MAX]; int length = strlen(path); struct stat sbuf; @@ -367,19 +367,17 @@ void check_options (void) if (!endOfDir) endOfDir = path+length; - if ((endOfDir-path+2) >= sizeof(m4_path)) { - path = endOfDir+1; - continue; - } - - strncpy(m4_path, path, sizeof(m4_path)); - m4_path[endOfDir-path] = '/'; - m4_path[endOfDir-path+1] = '\0'; - strncat(m4_path, m4, sizeof(m4_path)); - if (stat(m4_path, &sbuf) == 0 && - (S_ISREG(sbuf.st_mode)) && sbuf.st_mode & S_IXUSR) { - m4 = strdup(m4_path); - break; + { + char m4_path[endOfDir-path + 1 + m4_length + 1]; + + memcpy(m4_path, path, endOfDir-path); + m4_path[endOfDir-path] = '/'; + memcpy(m4_path + (endOfDir-path) + 1, m4, m4_length + 1); + if (stat(m4_path, &sbuf) == 0 && + (S_ISREG(sbuf.st_mode)) && sbuf.st_mode & S_IXUSR) { + m4 = strdup(m4_path); + break; + } } path = endOfDir+1; } while (path[0]); @@ -18,10 +18,10 @@ const char *skel[] = { "%# through m4. Macros beginning with `m4_' will be processed.", "%# The quoting is \"[[\" and \"]]\" so we don't interfere with", "%# user code.", - "%# ", + "%#", "%# All generate macros for the m4 stage contain the text \"m4\" or \"M4\"", "%# in them. This is to distinguish them from CPP macros.", - "%# The exception to this rule is YY_G, which is an m4 macro, ", + "%# The exception to this rule is YY_G, which is an m4 macro,", "%# but it needs to be remain short because it is used everywhere.", "%#", "/* A lexical scanner generated by flex */", @@ -34,7 +34,7 @@ const char *skel[] = { "m4_changequote", "m4_changequote([[, ]])", "", - "%# ", + "%#", "%# Lines in this skeleton starting with a \"%\" character are \"control lines\"", "%# and affect the generation of the scanner. The possible control codes are", "%# listed and processed in misc.c.", @@ -282,7 +282,7 @@ const char *skel[] = { "", "%if-c++-only", "/* begin standard C++ headers. */", - "#include <iostream> ", + "#include <iostream>", "#include <errno.h>", "#include <cstdlib>", "#include <cstdio>", @@ -303,13 +303,13 @@ const char *skel[] = { "%# e.g.,", "%# The function prototype", "%# int foo(int x, char* y);", - "%# ", + "%#", "%# ...should be written as", "%# int foo M4_YY_PARAMS(int x, char* y);", - "%# ", + "%#", "%# ...which could possibly generate", "%# int foo ();", - "%# ", + "%#", "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_PROTOS]],", "[[", " m4_define( [[M4_YY_PARAMS]], [[()]])", @@ -384,7 +384,7 @@ const char *skel[] = { "#define yy_flex_debug YY_G(yy_flex_debug_r)", "", "m4_define( [[M4_YY_INCR_LINENO]],", - "[[ ", + "[[", " do{ yylineno++;", " yycolumn=0;", " }while(0)", @@ -397,7 +397,7 @@ const char *skel[] = { "%if-not-reentrant", "", "m4_define( [[M4_YY_INCR_LINENO]],", - "[[ ", + "[[", " yylineno++;", "]])", "", @@ -554,7 +554,7 @@ const char *skel[] = { " [[", " /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires", " * access to the local variable yy_act. Since yyless() is a macro, it would break", - " * existing scanners that call yyless() from OUTSIDE yylex. ", + " * existing scanners that call yyless() from OUTSIDE yylex.", " * One obvious solution it to make yy_act a global. I tried that, and saw", " * a 5% performance hit in a non-yylineno scanner, because yy_act is", " * normally declared as a register variable-- so it is not worth it.", @@ -611,7 +611,7 @@ const char *skel[] = { "%endif", "", "%if-c++-only", - " std::streambuf* yy_input_file; ", + " std::streambuf* yy_input_file;", "%endif", "", "", @@ -649,7 +649,7 @@ const char *skel[] = { "", " int yy_bs_lineno; /**< The line count. */", " int yy_bs_column; /**< The column count. */", - " ", + "", "", " /* Whether to try to fill the input buffer when we reach the", " * end of it.", @@ -1387,7 +1387,7 @@ const char *skel[] = { "", "/** Describes a mapping from a serialized table id to its deserialized state in", " * this scanner. This is the bridge between our \"generic\" deserialization code", - " * and the specifics of this scanner. ", + " * and the specifics of this scanner.", " */", "struct yytbl_dmap {", " enum yytbl_id dm_id;/**< table identifier */", @@ -1872,7 +1872,7 @@ const char *skel[] = { " M4_YY_DECL_GUTS_VAR();", " char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;", " char *source = YY_G(yytext_ptr);", - " yy_size_t number_to_move, i;", + " int number_to_move, i;", " int ret_val;", "", " if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] )", @@ -1901,7 +1901,7 @@ const char *skel[] = { " /* Try to read more data. */", "", " /* First move last chars to start of buffer. */", - " number_to_move = (yy_size_t) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr)) - 1;", + " number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - 1);", "", " for ( i = 0; i < number_to_move; ++i )", " *(dest++) = *(source++);", @@ -1989,7 +1989,7 @@ const char *skel[] = { " else", " ret_val = EOB_ACT_CONTINUE_SCAN;", "", - " if ((int) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {", + " if ((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. */", " 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(", @@ -2552,10 +2552,10 @@ const char *skel[] = { " M4_YY_CALL_LAST_ARG);", " if ( ! YY_G(yy_buffer_stack) )", " YY_FATAL_ERROR( \"out of dynamic memory in yyensure_buffer_stack()\" );", - " ", - " ", + "", + "", " memset(YY_G(yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));", - " ", + "", " YY_G(yy_buffer_stack_max) = num_to_alloc;", " YY_G(yy_buffer_stack_top) = 0;", " return;", @@ -2591,7 +2591,7 @@ const char *skel[] = { " * @param base the character buffer", " * @param size the size in bytes of the character buffer", " * M4_YY_DOC_PARAM", - " * @return the newly allocated buffer state object. ", + " * @return the newly allocated buffer state object.", " */", "YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size)", "{", @@ -2662,11 +2662,11 @@ const char *skel[] = { " 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()\" );", @@ -2824,7 +2824,7 @@ const char *skel[] = { "int yyget_lineno YYFARGS0(void)", "{", " M4_YY_DECL_GUTS_VAR();", - " ", + "", " m4_ifdef( [[M4_YY_REENTRANT]],", " [[", " if (! YY_CURRENT_BUFFER)", @@ -2844,7 +2844,7 @@ const char *skel[] = { "int yyget_column YYFARGS0(void)", "{", " M4_YY_DECL_GUTS_VAR();", - " ", + "", " m4_ifdef( [[M4_YY_REENTRANT]],", " [[", " if (! YY_CURRENT_BUFFER)", @@ -3111,20 +3111,20 @@ const char *skel[] = { " errno = EINVAL;", " return 1;", " }", - " ", + "", " *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );", - " ", + "", " if (*ptr_yy_globals == NULL){", " errno = ENOMEM;", " return 1;", " }", - " ", + "", " /* By setting to 0xAA, we expose bugs in", " yy_init_globals. Leave at 0x00 for releases. */", " memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));", - " ", + "", " yyset_extra (yy_user_defined, *ptr_yy_globals);", - " ", + "", " return yy_init_globals ( *ptr_yy_globals );", "}", "", @@ -3482,7 +3482,7 @@ const char *skel[] = { " return NULL;", "}", "", - "/** Read a table while mapping its contents to the local array. ", + "/** Read a table while mapping its contents to the local array.", " * @param dmap used to performing mapping", " * @return 0 on success", " */", @@ -3527,7 +3527,7 @@ const char *skel[] = { "", " if(M4_YY_TABLES_VERIFY)", " /* We point to the array itself */", - " p = dmap->dm_arr; ", + " p = dmap->dm_arr;", " else", " /* We point to the address of a pointer. */", " *dmap->dm_arr = p = (void *) yyalloc (bytes M4_YY_CALL_LAST_ARG);", @@ -3574,7 +3574,7 @@ const char *skel[] = { " rv = yytbl_read8 (&t8, rd);", " t32 = t8;", " break;", - " default: ", + " default:", " YY_FATAL_ERROR( \"invalid td_flags\" ); /* TODO: not fatal. */", " return -1;", " }", @@ -3631,7 +3631,7 @@ const char *skel[] = { " YY_FATAL_ERROR( \"transition table not found\" ); /* TODO: not fatal. */", " return -1;", " }", - " ", + "", " if( M4_YY_TABLES_VERIFY)", " v = &(((struct yy_trans_info *) (transdmap->dm_arr))[t32]);", " else", @@ -3642,7 +3642,7 @@ const char *skel[] = { " YY_FATAL_ERROR( \"tables verification failed at YYTD_PTRANS\" );", " }else", " ((struct yy_trans_info **) p)[0] = v;", - " ", + "", " /* increment p */", " p = (struct yy_trans_info **) p + 1;", " }", @@ -3758,7 +3758,7 @@ const char *skel[] = { "", "/** Destroy the loaded tables, freeing memory, etc.. */", "int yytables_destroy YYFARGS0(void)", - "{ ", + "{", " struct yytbl_dmap *dmap=0;", "", " if(!M4_YY_TABLES_VERIFY){", |