The flex binary package comes with examples under /usr/share/doc/flex/examples/fastw . These were from 2016 and don't work as expected with current gcc and flex. Attached patch fix these issues. * need "int" for main * need tailing "%%" I think these may have been OK with old tool chain but they cause trouble these days. Now these can be compiled with ``` gcc -lfl mywc.c -o mywc for f in 1 2 3 4 5; do flex wc$f.l gcc -lfl lex.yy.c -o wc$f rm -f lex.yy.c done ``` These example files are from upstream source under https://salsa.debian.org/srivasta/flex/-/tree/master/examples/fastwc/
Hi, Oops, "-lfl" may have been redundant... Regards, Osamu