I created test.l, input to flex, which ends with the main function.
When the main function is implemented as:
int main(void) { yylex(); return 0; }
I have no problem.
I want to trick the parser into believing that the first character is always a semi-colon, so I implemented main as
int main(void) { unput(';'); yylex(); return 0; }
the above leads to a segment fault.
Why does the use of unput lead to a segment fault?