This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]