Repository navigation
Expand file tree
/
Copy pathNEWS
More file actions
1848 lines (1211 loc) · 66 KB
/
Copy pathNEWS
File metadata and controls
1848 lines (1211 loc) · 66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
flex NEWS
* Noteworthy changes in release ?.? (????-??-??) [?]
* Noteworthy changes in release 2.7.16 (2026-12-04) [stable]
** scanner
*** The yydecl option now works in a C++ scanner that also uses the yyclass option, such as one whose class has its own yylex() method with different arguments. Before, the generated scanner did not compile. (#949)
Thanks to Zartaj Majeed.
* Noteworthy changes in release 2.7.15 (2026-12-02) [stable]
** documentation
*** Updated fr translation from the Translation Project.
** scanner
*** A scanner built in a strict ISO C mode, such as -std=c99, compiles
on DragonFly BSD. Its <stdio.h> defines fileno as a macro, and the
declaration of fileno that flex adds in these modes was a syntax
error after that. Flex now leaves its own declaration out when
fileno is already a macro. (#936)
Thanks to John Marino.
* Noteworthy changes in release 2.7.14 (2026-12-01) [stable]
** scanner
*** A scanner built with -CF, or with %option fast, compiles again when
it has a rule that begins with ^. Flex wrote a stray pair of quote
marks and a comma in place of an equals sign in the generated code
that finds the start state, so the C compiler stopped with a syntax
error. This has been so since flex 2.6.5. -Cf and the default
table options were not affected. (#932)
Thanks to Sendao Yan.
* Noteworthy changes in release 2.7.13 (2026-11-30) [stable]
** documentation
*** Updated bg, ka, lv, nl, pl, pt, pt_BR, ro, sv, uk translations from
the Translation Project.
** scanner
*** A call in an action to one of the functions of flex 2.6.4 is read up
to its own closing parenthesis. Flex ended the arguments of
yyunput(), yyless() and the other calls at the first closing
parenthesis, so a cast or a nested call cut the call short. A
two-argument yyunput((int) 'b', (char *) yytext) was written as
unput() with two arguments, which does not compile. A parenthesis
or a comma inside a string or character constant no longer counts
either. (#926)
Thanks to a report from Harmen Stoppels.
*** A scanner reads at least 8192 bytes at a time again, as it did in
flex 2.6.4. Since flex 2.6.5 it read BUFSIZ bytes, which is only
1024 on systems with musl, such as Alpine Linux, and on the BSDs. A
scanner built there stopped with "flex scanner push-back overflow"
on a large unput, and so did flex itself. (#925)
Thanks to a report from jvvv.
*** The option -DNAME=VALUE works again. Flex wrote it as "#define
NAME=VALUE =VALUE", so the scanner would not compile. It now writes
"#define NAME VALUE", and -DNAME alone defines NAME as 1. (#923)
Thanks to a report from jvvv.
* Noteworthy changes in release 2.7.12 (2026-11-28) [stable]
** build
*** "make pdf" builds the PDF version of the manual again. Since flex
2.6.5-rc1 it stopped with the error "@TEXI2PDF@: command not found"
instead of running texi2dvi. The PDF is still not included in the
source distribution. (#537)
Thanks to a report from dctaylor87.
*** The repository has a git hook that checks the spelling of the files
in each commit with codespell, alongside the existing hook that
checks commit messages. A clone turns on both with
"git config core.hooksPath .githooks". Pull requests are checked
for spelling too. (#909)
** documentation
*** The copyright notices have been brought up to date. COPYING and the
manual now give the Flex Project's years as 2001-2026, where they
stopped at 2007. The installed FlexLexer.h header now carries the
Flex Project's copyright and license identifier, and says that a
C++ scanner that includes it is as free of the notice as a scanner
generated for any other language. (#485)
Thanks to a report from Simon Sobisch.
*** Misspellings in the manual have been corrected. (#909)
Thanks to a report from jschleus.
** scanner
*** The option --header-file now works with %option c++. Flex accepted
it and wrote nothing. For a C++ scanner it now writes the
FlexLexer.h of the flex that generated the scanner, and the scanner
includes that file by its name, without the directory, in place of
<FlexLexer.h>. A scanner built for another machine, as when
cross-compiling, then takes its header from the build instead of
from whatever copy the compiler finds on the system. Keep the file
in the scanner's directory, or add its directory to the include
path. (#483)
Thanks to a report from Daniel Colascione.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
* Noteworthy changes in release 2.7.1 (2026-11-18) [stable]
** scanner
*** A scanner whose yytext is a pointer, which is the default, no longer
reports a wrong yyleng, or reads memory in front of its input
buffer, when a rule's action calls yymore() and then uses unput()
to push back more characters than the rule matched. The next token
now starts with the pushed-back characters, as no yymore() text is
left to keep. (#874)
Thanks to anshal ossaimi.
* Noteworthy changes in release 2.7.0 (2026-11-18) [stable]
** scanner
*** A C++ scanner now stops the build with one message, naming the flex
version that generated it, when the FlexLexer.h it finds is from
another version of flex, as a copy kept in a project's own sources
can be. Before, the compiler reported many errors about members the
class did not have, such as yy_hold_ptr. FlexLexer.h now carries the
version of flex it comes from for this check. A FlexLexer.h from
flex 2.6.17 or earlier has no version and is refused as well;
replace it with the one from this flex. (#872)
* Noteworthy changes in release 2.6.17 (2026-11-18) [stable]
** scanner
*** A scanner no longer writes to memory in front of its input buffer
when a rule's action uses unput() to push back more characters than
the rule matched and then calls input() or yyinput() far enough to
read past the end of the buffer. Flex 2.6.16 did this on every later
call to input() or yyinput() in that action, which could corrupt
memory. (#873)
Thanks to anshal ossaimi.
* Noteworthy changes in release 2.6.16 (2026-11-17) [stable]
** scanner
*** After a rule's action has called input() or yyinput(), yytext as a
string ends where the token ends, as it did with flex 2.6.4. Flex
2.6.14 made it run on over the characters that had been read, so a
program that copied yytext after reading ahead, such as the
gobject-introspection comment scanner, got those characters twice.
The characters read are still left as they were in a buffer that
the program supplied, and yyleng is unchanged. (#870)
The C++ class yyFlexLexer in FlexLexer.h has one more member for
this, so a C++ program should be rebuilt, along with every library
of its own that includes FlexLexer.h, when it moves to this release.
*** yyless() after input() or yyinput() gives back the right text and
no longer writes a stale character over the end of the token. Before,
the program's own buffer could be changed and the next token could
start with the wrong character, as with flex 2.6.4.
* Noteworthy changes in release 2.6.15 (2026-11-15) [stable]
** scanner
*** A program can define YY_BREAK again, as it could with flex 2.6.4.
YY_BREAK is the code that ends each rule's action, and a program can
define it, for example to leave out the break and avoid warnings
about unreachable code. Flex 2.6.5 and later no longer used it, so
such a definition was ignored without any message. The default back
end uses it again. The post-action option still replaces it.
*** A program can declare yyinput() itself again, as it could with
flex 2.6.4. Flex 2.6.5 named the function that reads the next
character in a C scanner yyinput(), so a declaration such as
"extern int yyinput(void);" in a program's own header no longer
compiled, which stopped VirtualBox from building. The function is
called input() in a C scanner again, as in 2.6.4. In a rule's
action, yyinput() is still accepted and works as input(); anywhere
else in a C scanner, use input(). A C scanner that is compiled as
C++ keeps the name yyinput(), as in 2.6.4, and a C++ scanner is
unchanged. (#863)
*** Flex no longer writes past the end of a buffer on its stack when a
rule's action in a c99 or go scanner has a call to yypanic() or a
similar function that is as long as the C library's BUFSIZ or
longer (8192 bytes with glibc). Before, flex wrote the scanner
without the end of the call, so the C did not compile. (#864)
Thanks to anshal ossaimi.
* Noteworthy changes in release 2.6.14 (2026-11-15) [stable]
** scanner
*** After yyless() gives text back, the scanner now works out whether it is
at the start of a line from the text that is left. When the text kept
ends in a newline, a rule that starts with ^ can match what follows.
With yyless(0), the scanner is back at the line state it had before
the match. Before, the scanner kept the line state of the whole token,
and such a rule did not match. (#452)
Thanks to Todd C. Miller.
*** yyinput() no longer overwrites the characters it reads with NUL
bytes. A program that gave the scanner its own buffer with
yy_scan_buffer() found those characters gone from its buffer
afterwards. As a string, yytext now extends over the characters
that yyinput() has read, and yyleng, the length of the token, is
unchanged. (#396, #395)
Thanks to Satya Das.
* Noteworthy changes in release 2.6.13 (2026-11-14) [stable]
** scanner
*** A scanner built with %array no longer reads or writes before the
start of its input buffer when yymore() is used after the scanner
switches buffers, after unput() has pushed text back to the start
of the buffer, or after the program has lengthened yytext. Since
flex 2.6.5 the scanner could point yytext before the buffer, and the
next refill or yyless() then went outside it. The text saved by
yymore() now ends at the start of the buffer. (#809)
Thanks to anshal ossaimi.
*** A scanner with a very large set of rules is built correctly again.
Since flex 2.6.5, some of its tables could be given an element type
too small for the numbers stored in them. A C++ compiler rejected
the generated file with "narrowing conversion" errors. A C compiler
only warned, and in our test the scanner then looped forever.
Doxygen's code scanner is one example. Flex now chooses the types
as 2.6.4 did, and for a table of offsets or indexes by the largest
value it can hold. Two other tables of such a scanner are also half
the size they had become. (#816)
Thanks to Christoph Grüninger.
*** A scanner that loads its tables from a file works again on 32-bit
systems. Since flex 2.6.5 the loader took a table of indexes for a
table of integers where a pointer is four bytes wide, and refused
the file with "table id not found in map". The tests for tables
files failed on i686 and on 32-bit ARM. (#838)
Thanks to Christoph Grüninger.
* 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)
* Noteworthy changes in release 2.6.11 (2026-11-12) [stable]
** scanner
*** A C++ scanner now frees every buffer left on its buffer stack when
it is destroyed. Before, it freed only the top one, so each buffer
added with yypush_buffer_state() and not yet removed leaked its
memory. The C scanners already did this in yylex_destroy().
Thanks to anshal ossaimi.
** test
*** The scan_length tests could fail on some architectures, such as
aarch64, because two variables in each test could hold wrong values
after the test recovered from the expected fatal error. They are
now declared so that the compiler cannot do that. (#850)
Thanks to Funda Wang.
* Noteworthy changes in release 2.6.10 (2026-11-12) [stable]
** scanner
*** A generated scanner compiles again where the C library's <stdio.h>
does not define BUFSIZ, as in a freestanding build such as GRUB's.
Flex 2.6.5 and later sized each read with BUFSIZ, so the scanner
failed to compile there. It now uses BUFSIZ when it is defined and
8192 when it is not, in both the default and the c99 back end. In
the default back end, a definition of YY_READ_BUF_SIZE still takes
precedence over both. (#851)
Thanks to ojab.
* Noteworthy changes in release 2.6.9 (2026-11-11) [stable]
** scanner
*** Four names that programs used with flex 2.6.4, and that flex 2.6.5
changed, work again. The global debug flag is again called
yy_flex_debug (with a prefix, the prefix followed by _flex_debug),
so a program that declares it with its own extern declaration links
again; in a C++ scanner it is again the yy_flex_debug member of
yyFlexLexer. The buffer structure's member that records whether the
scanner is at the beginning of a line is again called yy_at_bol. A
definition of YY_READ_BUF_SIZE in the scanner file is used again.
Defining FLEXINT_H again keeps the scanner from declaring its own
integer types, for a program that supplies them. The new names
yyflexdebug and yyatbol() continue to work.
*** A generated scanner compiles again in a program that declares
YY_BUFFER_STATE itself, guarded by YY_TYPEDEF_YY_BUFFER_STATE, as it
did with flex 2.6.4. Flex 2.6.5 declared its new yybuffer type under
that same guard, so such a program got no yybuffer and the scanner
failed to compile. The two types now have separate guards. (#848)
Thanks to Patrik Obrist.
* Noteworthy changes in release 2.6.8 (2026-11-11) [stable]
** build
*** Flex now builds when configured with --disable-nls. It failed to
compile with a compiler that treats a call to an undeclared function
as an error, because the report of backing-up states used a function
that is only declared when translations are enabled. (#844)
Thanks to Hendrik Donner.
* Noteworthy changes in release 2.6.7 (2026-11-11) [stable]
** scanner
*** A generated scanner now compiles when the program is built in a
strict ISO C mode, such as -std=c99, with a compiler that treats a
call to an undeclared function as an error (GCC 14 and later, Clang
16 and later). Those modes hide a function the scanner needs to tell
whether its input is a terminal, and the scanner now declares it
itself. This also fixes "make check" failing in flex 2.6.6 with
those compilers. (#845)
Thanks to Philip Müller and K1ngfish3r for reporting it.
* Noteworthy changes in release 2.6.6 (2026-11-11) [stable]
** build
*** tools/bootstrap-flex now builds flex 2.6.5 and checks its signature
against the flex release key, as well as its hash. It needs gpg.
** scanner
*** A generated scanner no longer fails to compile in a program that
defines a macro named fallthrough, as the Linux kernel's headers do.
Flex 2.6.5 wrote the fall-through marker with that plain name, so
the macro was expanded inside the scanner. The scanner now uses the
reserved spelling __fallthrough__ for the attribute. (#842)
Thanks to Luca Bacci; reported by Philip Müller.
* Noteworthy changes in release 2.6.5 (2026-11-10) [stable]
** build
*** The ChangeLog that tools/git2cl writes is now valid UTF-8. Author
names with accented characters used to come out in a different
encoding from the rest of the file, and the script printed "Wide
character in print" warnings.
*** The ChangeLog in the nightly distribution tarballs is no longer
empty, and the nightly build now fails if it would be.
*** The script that updates the translations from the Translation
Project now converts any .po file that is not in UTF-8 to UTF-8, so
every translation in the source tree uses the same encoding.
*** The version and date in the header of each release's section of this
NEWS file, and the version in configure.ac, are now set together by
a script when the release is made. A release candidate gets its own
header in the same way.
*** Regenerating the build files now needs gettext 0.23 or later. The
po/ directory can then be built in parallel with make -j. Building
from a release tarball is not affected.
*** A new script, tools/bootstrap-flex, builds and installs the previous
release of flex. Building flex from a git checkout needs a flex that
is already installed, and the script lets a system without one get
started.
*** Building flex no longer rewrites the .po translation files.
*** A race condition that could build flex twice at the same time during
a parallel make has been fixed.
*** Releases are now made and signed by a GitHub workflow. Each release
has a detached signature for the tarballs and for a SHA256SUMS file,
and a copy of the public key. The key is new and is not connected to
the key that signed 2.6.4. The new key's fingerprint is 56D6 64C7
0CC2 364C F516 4914 B7DF E8BB 6C24 1FED. It is published on
keys.openpgp.org, at flexlexer.org, and in the README.
Thanks to Joseph Langley for substantial portions of this change.
*** Source files now carry SPDX license identifiers.
Thanks to Tuukka Pasanen.
*** The replacement malloc in lib/ now has a full prototype.
Thanks to Richard Barnes.
*** Automated builds now run on GitHub Actions instead of travis-ci, and
nightly distribution tarballs are built there.
Thanks to Joseph Langley.
*** The configure script accepts the space that AC_PROG_LEX puts before
the parentheses when checking for yymore and yyreject. It also no
longer uses obsolete Autoconf macros, and the macro that finds the C
compiler for the build machine has been updated to fix problems with
executable file names when cross compiling.
Thanks to Bill Currie and Kang-Che Sung.
*** The man page can now be built when cross compiling, including on
MS Windows. (#560)
*** Various edge cases, mostly involving out-of-tree builds have been
accounted for in the autotools build system.
Thanks to Michael Haubenwallner and Kang-Che Sung.
*** The build now has flex build its own scanner a second time and fails
if the result differs from the first. This check runs only for
native builds.
Thanks to Kang-Che Sung.
*** The GitHub Actions workflows now use pinned versions of the actions,
have read-only permissions, and are kept up to date by dependabot.
Thanks to Pedro Kaj Kjellerup Nacht.
*** The minimum versions of the Autotools needed to build flex are now
correct and documented, and autogen.sh is more reliable in finding
libtoolize.
Thanks to Kang-Che Sung.
*** Flex no longer searches PATH for m4 itself and leaves that to the
system. This avoids a failure on 32-bit systems that read file
systems with 64-bit inode numbers. (#413)
Thanks to Kang-Che Sung.
*** Flex no longer declares reallocarray() itself.
Thanks to Lukasz Baj.
*** Flex now includes its own <config.h> header before including system
headers so that any system specific features detected by configure
are taken into account during compilation of flex itself.
Thanks to Kang-Che Sung.
*** The flex build system now includes Makefile targets at the top level
to allow just building and installing libfl.
Thanks to Kang-Che Sung.
*** The flex distribution now includes a file, src/libfl.pc, to allow
using pkgconfig to find out what flags to use when building against
libfl from flex.
Thanks to Tyler Slabinski and Kang-Che Sung.
*** The skeleton files are now generated correctly on systems whose
files use CRLF line endings.
Thanks to Jannick.
*** A crash during building on NetBSD has been fixed.
Thanks to Thomas Klausner.
** documentation
*** Several examples in the manual have been corrected or modernized:
character classes, case-insensitive ranges, the patterns for C and
C++ comments, the Bison snippets, and a call to yylex_init_extra().
Thanks to Joseph Langley, Martin Joerg, zmajeed, Akim Demaille and
Nikolaos Chatzikonstantinou.
*** Typos in the manual and the README have been fixed.
Thanks to Houtan Bastani, Xiao Hanyu, winter.loo, musvaage and
6NoFantasy9.
*** INSTALL is now INSTALL.md and has updated instructions. There is a
new CONTRIBUTING.md, and the README now describes how to use the
mailing list and where to find releases.
Thanks to Joseph Langley and Simon Sobisch.
*** New bg, ka, lv, pt, uk translations from the Translation Project.
*** Updated ca, da, de, eo, es, fi, fr, ga, hr, ko, nl, pl, pt_BR, ro,
ru, sr, sv, tr, vi, zh_CN, zh_TW translations from the Translation
Project.
*** Added machine translations of the ca, da, de, eo, es, fi, ga, hr,
ka, ko, pt_BR, ru, sr, tr, vi, zh_CN messages that the Translation
Project had not updated. A native speaker has not reviewed them, and
each one is marked as machine translated in its .po file.
Translations from the Translation Project will replace them.
*** The --yymore option is now documented.
Thanks to ggujjula.
*** The manual now describes how to retarget flex to other languages and
lists the deprecated interfaces and their replacements.
Thanks to Eric S. Raymond and Daniel Brooks.
*** The flex manual is now on the web at
https://westes.github.io/flex/manual/, split into one page per
section, and as a single page at
https://westes.github.io/flex/manual-single.html. General
information about flex is at https://westes.github.io/flex/. The
site is rebuilt from the flex sources for each release.
** scanner
*** A generated scanner now marks the places where it falls through from
one case to the next with the fall-through attribute, where the
compiler supports it, instead of only a comment. Clang, which
ignores the comment, no longer warns about them under
-Wimplicit-fallthrough. This covers the end-of-file cases for start
conditions without an <<EOF>> rule and the fall-through in
yyinput(). (#427, #709)
Thanks to Luca Bacci.
*** A scanner that defines YY_NO_INPUT or YY_NO_UNPUT in section 1 again
has yyinput() or yyunput() left out, as in flex 2.6.4, and no longer
gets warnings about unused functions. The new names YY_NO_YYINPUT
and YY_NO_YYUNPUT work as well. (#804)
Thanks to Christoph Grüninger.
*** A scanner that defines its own ECHO macro again has it used, both
by ECHO actions and by the default rule, as in flex 2.6.4, and no
longer gets a warning that ECHO is redefined. Defining yyecho()
takes precedence over defining ECHO. (#803)
Thanks to Christoph Grüninger.
*** A scanner that defines its own YY_INPUT or yyread() can again create
a buffer from a NULL file, for example with yy_create_buffer(NULL,
size), and have it filled through that routine, as in flex 2.6.4.
Such a buffer is treated as empty only when the scanner reads its
input with flex's own routine, which needs a file to read from.
(#802)
Thanks to Christoph Grüninger.
*** The header file written by the --header-file option no longer
contains the code from section 3 of the scanner file, such as
function definitions. A scanner whose header was included in other
source files could fail to compile or link because of it. (#801)
Thanks to Christoph Grüninger.
*** yy_scan_string() and yy_scan_bytes() no longer write outside the
buffer they allocate when the input is too long for an int, or when
the length given to yy_scan_bytes() is negative. They now stop with
the fatal error "string too long for yy_scan_string()" or "negative
length in yy_scan_bytes()". Input longer than an int can hold was
never supported; before, it could corrupt the heap. (#446, #664)
Thanks to anshal ossaimi.
*** A scanner file could run commands while flex was running by
putting m4 macros in the values of options such as outfile,
header-file, yydecl, user-init, pre-action and post-action. Flex
now passes those values through as plain text, and rejects the
characters '[' and ']' in them, in the output and header file
names, in the class name given to yyclass, and in the prefix.
(#728)
Thanks to MarkLee131.
*** The --skel (-S) option again makes flex read the skeleton file it
names. Flex had been accepting the option but using its built-in
skeleton anyway.
*** Scanners that use REJECT no longer write past the end of their
state buffer when a buffer larger than the default is installed
with yypush_buffer_state() and a long token is then scanned. (#752)
Thanks to anshal ossaimi.
*** C++ scanners that use REJECT now allocate their state buffer with
yyalloc() and release it with yyfree(), as C scanners do. Before,
switching to an input buffer larger than the default could pass
memory obtained with new[] to yyrealloc(), and a scanner that
defines its own yyalloc(), yyrealloc() and yyfree() received a
pointer its yyalloc() had never returned. (#751)
Thanks to anshal ossaimi.
*** Flex no longer writes one byte past the end of a buffer when the
name of the output file given with -o is very long and contains
enough backslashes or double quotes. (#749)
Thanks to ReisterJ.
*** The messages Flex prints are easier to translate, and more of them
are offered to the Translation Project. The --help text is split
into several messages. Words that must not be translated, such as
option and keyword names, are no longer part of the messages. The
statistics printed by -v and the dumps printed in debug mode are
no longer marked for translation, so they appear in English. The
messages in five source files that were never offered for
translation now are, and the word "warning" at the start of each
warning is translated. Seven short error messages, such as
"premature EOF" and "bad character class", now say what is wrong.
*** The --help text showed the -T option as --env.trace, and the message
about using -l with --reentrant called that option --ctrl.reentrant.
Both now show the right option names.
*** Scanners generated with --tables-file or --tables-verify now check
the tables file they read at run time. A damaged or hostile file
could make such a scanner read outside its memory, write outside it,
or ask for a huge amount of it. Now yytables_fload() returns -1 for
such a file. A scanner that is already built is not changed, so it
must be generated again with this version of Flex. (#730)
Thanks to MarkLee131.
*** With %array, a switch to another input buffer now ends the text
saved by yymore(), as it does with %pointer. Before, calling yyless()
with a count shorter than that text after the switch could move the
scanner to before the start of the new buffer.
*** With %array, calling yyless() with a count shorter than the text
saved by yymore() now returns the rest of that text to the input, as
it does with %pointer. Before, that text was dropped and never
scanned again. With yylineno, the newlines in it are counted once.
*** With %option yylineno, a newline matched by the default rule is now
counted in yylineno. Before, yylineno did not change when the
default rule matched a newline. (#397)
Thanks to ggujjula; reported by Horst H. von Brand.
*** With %array, calling yyless() after yymore() could write past the
end of the input buffer. This has been fixed.
Thanks to anshal ossaimi.
*** A heap buffer overflow that could happen when flex_main() was called
more than once in the same process has been fixed.
Thanks to David Pokora of Trail of Bits, in collaboration with
Anthropic.
*** Flex no longer puts #line directives from %top blocks into the
output when --noline or %option noline is given. (#463, #268)
Thanks to Javier Maestro.
*** A bug in how yylex_destroy() frees the buffer stack has been fixed.
Thanks to Wiktor Garbacz.
*** Refilling the input buffer is a little faster.
Thanks to John Lindal.
*** When the input buffer is grown, the new size now always includes
room for the final two end-of-buffer characters.
Thanks to David Lamparter.
*** Generated scanners now compile without warnings in more situations,
for example with -Wextra-semi-stmt (#416), -Wundef,
-Wnull-dereference (#377), when yyunput is disabled, and when
comparing sizes.
Thanks to Sean McBride, Alex Richardson, Kang-Che Sung and Bill
Currie.
*** The error message for a file that cannot be opened now includes the
system's reason.
Thanks to Ryan McCullagh.
*** Some memory leaks have been fixed.
Thanks to viktor.shepel and Kang-Che Sung.
*** Scanners generated with the --full option no longer allocate table
space that is never used. (#628)
Thanks to Joseph Langley.
*** Line numbers in #line directives were off by one after an indented
code block in the rules section. This has been fixed.
Thanks to Bill Currie.
*** A leftover reference to the old location of the line directive
template in the output filter was corrected.
Thanks to Burke Libbey.
*** A crash while starting m4 on Apple M1 has been fixed. (#539)
Thanks to Yifeng Li.
*** Scanners now fail with an error, rather than misbehaving, when
yy_get_next_buffer() cannot find a buffer. (#525)
Thanks to Joseph Langley.
*** The generated header flexint_shared.h can now be included twice
without errors (#329), and it uses <cstdint> when compiled as C++11
or later. (#517)
Thanks to Kang-Che Sung.
*** New options: --noinput and --noyyinput, --noyyget_debug and
--noyyset_debug. The existing --nounput can now also be written
--noyyunput.
Thanks to ggujjula and Eric S. Raymond.
*** Scanners that call yy_switch_to_buffer() with REJECT now always have
a large enough state buffer.