This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: treedraw: compilation error
- From: "Rupert Wood" <me at rupey dot net>
- To: "'Gerhard Reuteler'" <gerhard dot reuteler at aon dot at>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Tue, 21 May 2002 09:48:21 +0100
- Subject: RE: treedraw: compilation error
Gerhard Reuteler wrote:
> gcc -g -w -c lex.yy.c
> lex.yy.c:20: initializer element is not constant
> lex.yy.c:20: initializer element is not constant
> make: *** [lex.yy.o] Error 1
:
> FILE *yyin =stdin, *yyout =stdout; <---- this is line 20
This one gets a mention in the GCC commonly reported bugs list:
http://gcc.gnu.org/bugs.html#c
glibc doesn't implement stdin/out as constants. From the bugs page,
This construct commonly occurs in code generated by old versions
of lex or yacc. We suggest you try regenerating the parser with a
current version of flex or bison, respectively. In your own code,
the appropriate fix is to move the initialization to the beginning
of main.
flex, a replacement for lex, may already be part of your OS distribution
or you can find the source on any GNU mirror, e.g.
http://sunsite.org.uk/gnu/non-gnu/flex/
Good luck,
Rup.