According to lex(1) (the manual page for flex, which is what we use for lex): Finally, note that you cannot put back EOF to attempt to mark the input stream with an end-of-file. Fixes PR bin/8707, which had been reclassified as a toolchain bug.