Skip to content

Releases

flex 2.7.11

Choose a tag to compare

@github-actions github-actions released this 27 Nov 10:57

Noteworthy changes in release 2.7.11 (2026-11-27) [stable]

scanner

  • A scanner generated in C mode and compiled as C++ defines its
    buffer struct as yy_buffer_state again, as it did before 2.7.8.
    Flex 2.7.8 renamed it to yy_c_buffer_state, so a program that
    declares struct yy_buffer_state itself failed to link with such a
    scanner. A program that links one with a scanner generated with
    %option c++ can still give the C scanner a different struct name by
    defining YY_C_BUFFER_STATE_TAG, for example as yy_c_buffer_state,
    wherever it includes the C scanner's header. (#910)

    Thanks to K1ngfish3r.

flex 2.7.10

Choose a tag to compare

@github-actions github-actions released this 26 Nov 12:06

Noteworthy changes in release 2.7.10 (2026-11-26) [stable]

scanner

  • A scanner whose <<EOF>> rule has the action '|', so that it shares
    the action of the rule after it, can be generated again. Flex 2.7.9
    stopped with the m4 error "end of file in string" on such a rule.
    (#906)

    Thanks to George Rubin.

  • A scanner generated with -F or -CF no longer reads past the end of
    its transition table when its input contains a NUL character.
    (#628, #908)

    Thanks to anshal ossaimi.

flex 2.7.9

Choose a tag to compare

@github-actions github-actions released this 24 Nov 20:17

Noteworthy changes in release 2.7.9 (2026-11-24) [stable]

scanner

  • The #line directive that switches back to the generated file after
    each rule action now comes before the code that ends the rule, such
    as YY_BREAK, so that code is no longer attributed to the scanner
    file. Two more directives that pointed into the scanner file are
    gone: the one before the case label of a rule whose action is '|',
    and a repeated directive after the default rule. (#903)

    Thanks to Szabolcs Horvát.

flex 2.7.8

Choose a tag to compare

@github-actions github-actions released this 24 Nov 14:00

Noteworthy changes in release 2.7.8 (2026-11-24) [stable]

scanner

  • A scanner generated in C mode and compiled as C++ no longer defines
    a struct named yy_buffer_state, so it can be linked into the same
    program as a scanner generated with %option c++ without two
    different definitions of that struct. The C scanner's struct is now
    named yy_c_buffer_state in that case. A scanner compiled as C is
    unchanged, as are YY_BUFFER_STATE and yybuffer in both languages.
    Code that names struct yy_buffer_state directly in a C scanner
    compiled as C++ must use yy_c_buffer_state, or the typedefs, instead.
    (#831)

    Thanks to DingdWang.

flex 2.7.7

Choose a tag to compare

@github-actions github-actions released this 24 Nov 11:06

Noteworthy changes in release 2.7.7 (2026-11-24) [stable]

scanner

  • The #line directives in a generated scanner now switch back to the
    generated file after each rule action, as Bison does, and the
    default rule no longer gets a #line directive of its own. Before,
    the code flex adds between actions, and the default rule, were
    attributed to lines of the scanner file, some of which did not
    exist. Compiler messages and coverage tools such as lcov 2.1 and
    later then pointed at the wrong lines or failed. (#903)

    Thanks to Szabolcs Horvát.

flex 2.7.6

Choose a tag to compare

@github-actions github-actions released this 23 Nov 15:59

Noteworthy changes in release 2.7.6 (2026-11-23) [stable]

scanner

  • A scanner no longer defines _POSIX_C_SOURCE and _POSIX_SOURCE ahead
    of the program's own code, and no longer includes <assert.h> for
    that purpose. Flex 2.6.5 to 2.7.5 did, which on systems whose
    headers hide declarations when those macros are set removed names
    the program uses: fileno_unlocked, which stopped GCC's Modula-2
    scanner from compiling, and SO_REUSEPORT, which stopped a program
    that includes boost asio. A strict ISO C mode still gets its own
    declaration of fileno. (#900, #901)

    Thanks to barracuda156 and fxdupont.

flex 2.7.5

Choose a tag to compare

@github-actions github-actions released this 23 Nov 13:53

Noteworthy changes in release 2.7.5 (2026-11-23) [stable]

scanner

  • Flex no longer writes outside its own buffers when a quoted %option
    value or a #line file name in the scanner file starts with a NUL
    byte. A NUL byte further inside such a value now cuts the value
    there and no longer also drops the character before it. (#725)

    Thanks to anshal ossaimi; reported by Marc Schoenefeld.

flex 2.7.4

Choose a tag to compare

@github-actions github-actions released this 23 Nov 01:17

Noteworthy changes in release 2.7.4 (2026-11-23) [stable]

build

  • Regenerating the build files now needs libtool 2.4.7 or newer. The
    first release whose configure script works on macOS 12 and later is
    2.4.7, and flex had asked only for 2.2. The release tarballs are now
    made with libtool 2.6.2, the current release. The release check now
    stops if it finds a configure script made by an older libtool; its
    earlier test looked for text that no released libtool writes. (#888)

    Thanks to Ryan Carsten Schmidt.

scanner

  • A program that declares struct yyguts_t itself, before the scanner,
    and supplies its own yyscan_t by defining YY_TYPEDEF_YY_SCANNER_T,
    compiles again with a prefixed reentrant scanner. Flex 2.7.3 put the
    prefix in the name of that structure, which made the program's
    declaration a different type from the scanner's, and doxygen would
    not build. Flex now leaves the name alone when the program defines
    YY_TYPEDEF_YY_SCANNER_T. A program that wants a prefixed name there
    can declare struct <prefix>guts_t. (#895)

    Thanks to Lars Wendler.

  • A reentrant C scanner can again set the member yy_flex_debug_r of
    its state structure, as it could with flex 2.6.4. Flex 2.6.5 renamed
    it to yyflexdebug_r, which stopped csound from building. The new
    name yyflexdebug, and the function yyset_debug(), still work. (#896)

    Thanks to CelestifyX.

flex 2.7.3

Choose a tag to compare

@github-actions github-actions released this 20 Nov 19:49

Noteworthy changes in release 2.7.3 (2026-11-20) [stable]

build

  • The release tarballs are now made with libtool 2.4.7, which has the
    fix that lets the configure script work on macOS 12 and later. The
    configure script in the 2.7.2 tarball was made with libtool 2.4.6
    and does not. The release check now stops if it finds the old
    script. (#888)

    Thanks to Ryan Carsten Schmidt.

scanner

  • A reentrant scanner made with a prefix now puts the prefix in the
    name of its state structure, yyguts_t, as it does for its other
    names. Before, two such scanners with different extra types, built
    as C++ and linked into one program, made the compiler warn that
    yyguts_t violates the One Definition Rule. Code that writes struct
    yyguts_t keeps working. (#877)

    Thanks to albert-github.

  • A scanner file could run commands while flex was running by putting
    m4 macros in the file name of a #line directive, and so could the
    name of the input file given on the command line. Flex now rejects
    the sequences [[ and ]] in those names. A single bracket is still
    allowed. (#879)

    Thanks to anshal ossaimi.

  • A scanner no longer writes into memory it has freed when a rule's
    action calls input() at the end of the buffer, which can move the
    buffer, and then calls yyless(). (#889)

    Thanks to anshal ossaimi.

  • A scanner whose error handler does not end the program, because it
    uses longjmp() or throws an exception, no longer writes in front of
    its start-condition stack after yy_pop_state() is called on an
    empty stack. Before, the stack position was left below zero, and
    the next yy_push_state() wrote at that position. (#887)

    Thanks to anshal ossaimi.

  • A batch scanner (-B) with compressed tables now matches a NUL byte
    that cannot extend the current token on its own. Since flex 2.6.5,
    the NUL was swallowed into the previous token. (#885)

    Thanks to Olivier Paquet.

flex 2.7.2

Choose a tag to compare

@github-actions github-actions released this 19 Nov 12:20

Noteworthy changes in release 2.7.2 (2026-11-19) [stable]

scanner

  • A scanner made with -Cf or -CF, without -Ce and without -7 or -8,
    now handles input bytes above 127. Before, flex made such a scanner
    7-bit, so its tables had no entries for those bytes, and a scanner
    given one read memory past its tables and could skip input or crash.
    These scanners are now 8-bit unless -7 is given, so their tables
    are larger. Building flex with -DDEFAULT_CSIZE=128 restores the old
    default. (#880)

    Thanks to anshal ossaimi.