#515 SDCC doesn't build with the new flex


Starting with flex 2.5.31, some things are no more
allowed in the .lex file, to be more compliant with the
POSIX standard.

When trying to build the latest CVS (from 14th may), I
get the following errors:

colorgcc -Wall -pipe -ggdb -g -O2 -I. -I..
-I../support/Util -c SDCCutil.c -o SDCCutil.o
colorgcc -Wall -pipe -ggdb -g -O2 -I. -I..
-I../support/Util -c SDCCdebug.c -o SDCCdebug.o
colorgcc -Wall -pipe -ggdb -g -O2 -I. -I..
-I../support/Util -c cdbFile.c -o cdbFile.o
colorgcc -Wall -pipe -ggdb -g -O2 -I. -I..
-I../support/Util -c SDCClex.c -o SDCClex.o
SDCC.lex:45: redefinition of `yylineno'
<stdout>:335: `yylineno' previously defined here
SDCC.lex:50: syntax error before "YY_PROTO"
SDCC.lex: In function `stringLiteral':
SDCC.lex:376: `yytext_ptr' undeclared (first use in
this function)
SDCC.lex:376: (Each undeclared identifier is reported
only once
SDCC.lex:376: for each function it appears in.)
{standard input}: Assembler messages:
{standard input}:5838: Error: symbol `yylineno' is
already defined
make[1]: *** [SDCClex.o] Error 1
make[1]: Leaving directory `/scratch/sdcc.pb/src'
make: *** [sdcc-cc] Error 2

I made a patch (see attached file), but I am not sure
it is 100% correct, as it is the first time I made some
modification in .lex files.



  • Aurelien Jarno

    Aurelien Jarno - 2003-05-14

    Patch for building SDCC with the new flex

  • Nick Craig-Wood

    Nick Craig-Wood - 2003-05-19

    Logged In: YES

    Renaming yylineno is the approach we took in one of our projects
    when we came across this exact problem - you've taken this
    approach in your patch which looks good to me!

  • Bernhard Held

    Bernhard Held - 2003-05-20
    • status: open --> closed
  • Bernhard Held

    Bernhard Held - 2003-05-20

    Logged In: YES

    Patch applied.

  • Bernhard Held

    Bernhard Held - 2003-05-20
    • assigned_to: nobody --> bernhardheld
    • status: closed --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks