Noteworthy changes in release 2.6.12 (2026-11-14) [stable]
scanner
-
A program can declare yyunput() itself again, as it could with
flex 2.6.4. Flex 2.6.5 made yyunput a one-argument macro, so a
declaration such as "static void yyunput (int c, char *buf_ptr);",
which some programs write to silence an unused-function warning,
no longer compiled. The scanner's function is called yyunput again,
with the arguments it had in 2.6.4, and in a C++ scanner it is the
yyFlexLexer member of that name again. The macro is gone from the
default back end. In a rule's action, yyunput(c) is still accepted
and works as unput(c); anywhere else, use unput(c). (#858) -
A program can have its own functions named yybegin, yyecho,
yystart, yyatbol or yysetbol, as GCC does with yybegin, and they
compile again. Flex 2.6.5 defined these names as macros, which
rewrote the program's declarations and definitions. The default
back end no longer defines them. Inside a rule's action flex still
accepts them and writes the old interface in their place: BEGIN,
ECHO, YY_START, YY_AT_BOL() and yy_set_bol(). Outside an action,
use the old interface. (#856) -
A C++ scanner built with %option nodefault compiles again. Flex
2.6.5 and later generated a call to yypanic(), which a C++ scanner
does not have, for input that no rule matches. It now goes through
YY_FATAL_ERROR, and so to LexerError(), as in 2.6.4. (#858) -
A program can call yy_fatal_error(), the 2.6.4 name of yypanic(),
again. YY_BUF_SIZE and YY_READ_BUF_SIZE are defined before the
scanner's first section again, so the program can use them there.
(#858) -
A non-reentrant C scanner whose rules never need backing up no
longer declares the two unused variables yy_last_accepting_state
and yy_last_accepting_cpos. Flex 2.6.5 and later declared them
anyway, so building such a scanner, for example one made with
%option full, stopped a program that compiles with -Werror, such
as the Kconfig lexer in the Xen hypervisor. (#859)Thanks to Christoph Grüninger.
test
- "make check" now tests only the build of flex. The tests of the
maintainer scripts in tools/ were part of it, and three of them
build small git repositories, so a build from a tarball failed
where git was not installed. They now run with "make check-tools".
(#857)