[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
YY_INPUT causes crash
From: |
James Hughes |
Subject: |
YY_INPUT causes crash |
Date: |
Thu, 18 Jul 2002 08:36:43 -0400 |
User-agent: |
Mutt/1.4i |
Hello,
I have been learning how to use flex, and had some success with
it early on, but then put it aside. When picking it up again, I found
I had some compile problems with the app I was working on, and decided
to go back to first principles.
The problem is, every simple example I try crashes as soon as I hit the
enter key. For instance, the following flex file:
%{
#include <stdio.h>
%}
%%
stop printf("Stop command received\n");
start printf("Start command received\n");
%%
With gdb, I've traced the problem to the YY_INPUT macro,
specifically the call to getc(yyin). I have tried replacing
getc with both fread() and fgetc(): same results. Same results
with other simple 'hello world' examples, including the "num_lines,
num_chars example" from the flex manual.
I compile with
address@hidden:~/dev/flex$ flex manex1.ll
address@hidden:~/dev/flex$ gcc -o manex1 lex.yy.c -lfl
Thanks for any help.
James
pgp1h9DrrbmMg.pgp
Description: PGP signature
- YY_INPUT causes crash,
James Hughes <=