This patch includes minor changes to files that wouldn't compile with flex 2.5.39.
Index: usr.sbin/config/scan.l =================================================================== RCS file: /cvs/src/usr.sbin/config/scan.l,v retrieving revision 1.22 diff -u -p -u -r1.22 scan.l --- usr.sbin/config/scan.l 16 Jan 2015 06:40:16 -0000 1.22 +++ usr.sbin/config/scan.l 7 Nov 2015 05:26:23 -0000 @@ -67,9 +67,9 @@ struct incl { static struct incl *incl; static int endinclude(void); -#define yywrap() 1 - %} + +%option noyywrap PATH [A-Za-z_0-9]*[./][-A-Za-z_0-9./\$\{\}]* WORD [A-Za-z_][-A-Za-z_0-9]* Index: lib/libkeynote/keynote.l =================================================================== RCS file: /cvs/src/lib/libkeynote/keynote.l,v retrieving revision 1.21 diff -u -p -u -r1.21 keynote.l --- lib/libkeynote/keynote.l 4 Feb 2015 20:35:51 -0000 1.21 +++ lib/libkeynote/keynote.l 7 Nov 2015 05:26:23 -0000 @@ -746,7 +746,6 @@ keynote_get_envlist(char *buf, char *buf if (0) { yyunput(0, NULL); - yy_flex_realloc(0, 0); } return en; Index: lib/libkeynote/keynote-ver.l =================================================================== RCS file: /cvs/src/lib/libkeynote/keynote-ver.l,v retrieving revision 1.16 diff -u -p -u -r1.16 keynote-ver.l --- lib/libkeynote/keynote-ver.l 29 Nov 2013 19:00:51 -0000 1.16 +++ lib/libkeynote/keynote-ver.l 7 Nov 2015 05:26:23 -0000 @@ -252,7 +252,6 @@ read_environment(char *filename) if (0) { yyunput(0, NULL); - yy_flex_realloc(0, 0); } } Index: sbin/wsconsctl/map_scan.l =================================================================== RCS file: /cvs/src/sbin/wsconsctl/map_scan.l,v retrieving revision 1.5 diff -u -p -u -r1.5 map_scan.l --- sbin/wsconsctl/map_scan.l 18 Apr 2015 18:28:37 -0000 1.5 +++ sbin/wsconsctl/map_scan.l 7 Nov 2015 05:26:23 -0000 @@ -30,6 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ +%option noyywrap + %{ #include <dev/wscons/wsksymdef.h> @@ -38,8 +40,6 @@ #include <err.h> #include "wsconsctl.h" #include "y.tab.h" - -#define yywrap() 1 void map_scan_setinput(char *str)