RE: [GRASS5] GRASS 5.1 compile error

> gcc -g -Wall -Wall -I/data/GRASSCVS/grass51/include
> -I/data/GRASSCVS/grass51/dist.i686-pc-linux-gnu/include
> -I/data/GRASSCVS/grass51/include
> -I/data/GRASSCVS/grass51/dist.i686-pc-linux-gnu/include \
> -o OBJ.i686-pc-linux-gnu/lex.yy.o -c lex.yy.c
> lex.l: In function `yyerror':
> lex.l:235: `YY_FLUSH_BUFFER' undeclared (first use in this function)
> lex.l:235: (Each undeclared identifier is reported only once
> lex.l:235: for each function it appears in.)
> lex.l: At top level:

Moritz.

I had the same problem a few weeks ago. I found at Google that it
seems to be related to an ancient bug in flex.

As a followup:

I've found that current flex version is 2.5.31 in:

http://sourceforge.net/projects/lex/

This is the one being distributed with Debian Unstable. When using
the version included with Debian, I get the same error of Moritz.

gfv@caca:~/grass/grass51$ flex -V
flex 2.5.31
gfv@caca:~/grass/grass51$ make
[...]
        -o OBJ.i686-pc-linux-gnu/lex.yy.o -c lex.yy.c
lex.l: En la funci?n `yyerror':
lex.l:235: error: `YY_FLUSH_BUFFER' undeclared (first use in this
function)
lex.l:235: error: (Each undeclared identifier is reported only once
lex.l:235: error: for each function it appears in.)
/usr/include/stdlib.h: En el nivel principal:
/home/gfv/grass/grass51/include/sqlp.h:145: aviso: `newNode' declared
`static' but never defined
make[3]: *** [OBJ.i686-pc-linux-gnu/lex.yy.o] Error 1
make[3]: Leaving directory `/home/gfv/grass/grass51/lib/db/sqlp'
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/home/gfv/grass/grass51/lib/db'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/gfv/grass/grass51/lib'
make: *** [default] Error 1

I had downloaded 2.5.4a version from

ftp://ftp.gnu.org/non-gnu/flex

and compiled it.

When compiling ("make" after "make clean") GRASS with
the PATH set to /usr/local/bin before /usr/bin,
(IOW: using the version 2.5.4a from sources instead of
version 2.5.31),
everithing goes OK(*).

I was going to fill a bug on Debian flex, but before that:

Moritz, are you using Debian unstable?
Others using Debian unstable, can you confirm this problem?

Regards

Gonzalo

(*)Side note: Last night, after cvs up -dP, make clean
make mix, make, I got a new error I hadn't had before.
[...]
gcc -g -mcpu=pentiumpro -O2 -Wall -I/home/gfv/grass/grass51/include
-I/home/gfv/grass/grass51/dist.i686-pc-linux-gnu/include
-I/home/gfv/grass/grass51/include
-I/home/gfv/grass/grass51/dist.i686-pc-linux-gnu/include \
        -o OBJ.i686-pc-linux-gnu/spot_dist.o -c spot_dist.c
spot_dist.c:57: aviso: return type defaults to `int'
spot_dist.c: En la funci?n `spot_dist':
spot_dist.c:84: aviso: type defaults to `int' in declaration of `i'
spot_dist.c:122:9: falta car?cter terminando "
spot_dist.c:123:8: falta car?cter terminando "
spot_dist.c:64: aviso: unused variable `F'
spot_dist.c:140: aviso: control reaches end of non-void function
/usr/include/bits/mathinline.h: En el nivel principal:
/home/gfv/grass/grass51/include/gis.h:36: aviso: `GRASS_copyright'
defined but not used
make[3]: *** [OBJ.i686-pc-linux-gnu/spot_dist.o] Error 1
make[3]: Leaving directory
`/home/gfv/grass/grass51/raster/wildfire/r.ros'
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/home/gfv/grass/grass51/raster/wildfire'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/gfv/grass/grass51/raster'
make: *** [default] Error 1

The error is in lines 122-123, and it says something like
missing closing "

I edited raster/wildfire/r.ros/spot_dist.c to include a backslash,
but spot_dist.c seems to be untouched the last 3 years, so I don't
know if it's my fault.

GFernandez-Victorio@igae.minhac.es said:

> gcc -g -Wall -Wall -I/data/GRASSCVS/grass51/include
> -I/data/GRASSCVS/grass51/dist.i686-pc-linux-gnu/include
> -I/data/GRASSCVS/grass51/include
> -I/data/GRASSCVS/grass51/dist.i686-pc-linux-gnu/include \
> -o OBJ.i686-pc-linux-gnu/lex.yy.o -c lex.yy.c
> lex.l: In function `yyerror':
> lex.l:235: `YY_FLUSH_BUFFER' undeclared (first use in this function)
> lex.l:235: (Each undeclared identifier is reported only once
> lex.l:235: for each function it appears in.)
> lex.l: At top level:

Moritz.

I had the same problem a few weeks ago. I found at Google that it
seems to be related to an ancient bug in flex.

As a followup:

I've found that current flex version is 2.5.31 in:

http://sourceforge.net/projects/lex/

This is the one being distributed with Debian Unstable. When using
the version included with Debian, I get the same error of Moritz.

gfv@caca:~/grass/grass51$ flex -V
flex 2.5.31
gfv@caca:~/grass/grass51$ make
[...]
        -o OBJ.i686-pc-linux-gnu/lex.yy.o -c lex.yy.c
lex.l: En la funci?n `yyerror':
lex.l:235: error: `YY_FLUSH_BUFFER' undeclared (first use in this
function)
lex.l:235: error: (Each undeclared identifier is reported only once
lex.l:235: error: for each function it appears in.)
/usr/include/stdlib.h: En el nivel principal:
/home/gfv/grass/grass51/include/sqlp.h:145: aviso: `newNode' declared
`static' but never defined
make[3]: *** [OBJ.i686-pc-linux-gnu/lex.yy.o] Error 1
make[3]: Leaving directory `/home/gfv/grass/grass51/lib/db/sqlp'
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/home/gfv/grass/grass51/lib/db'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/home/gfv/grass/grass51/lib'
make: *** [default] Error 1

I had downloaded 2.5.4a version from

ftp://ftp.gnu.org/non-gnu/flex

and compiled it.

When compiling ("make" after "make clean") GRASS with
the PATH set to /usr/local/bin before /usr/bin,
(IOW: using the version 2.5.4a from sources instead of
version 2.5.31),
everithing goes OK(*).

I was going to fill a bug on Debian flex, but before that:

Moritz, are you using Debian unstable?
Others using Debian unstable, can you confirm this problem?

No, I am using Debian testing, but the flex version is the same : 2.5.31-3.

The current version in unstable is 2.5.31-8, but even after installing
this, I get the same error.

Moritz

On Wed, 21 May 2003, GFernandez-Victorio@igae.minhac.es wrote:

> gcc -g -Wall -Wall -I/data/GRASSCVS/grass51/include
> -I/data/GRASSCVS/grass51/dist.i686-pc-linux-gnu/include
> -I/data/GRASSCVS/grass51/include
> -I/data/GRASSCVS/grass51/dist.i686-pc-linux-gnu/include \ -o
> OBJ.i686-pc-linux-gnu/lex.yy.o -c lex.yy.c lex.l: In function
> `yyerror': lex.l:235: `YY_FLUSH_BUFFER' undeclared (first use in
> this function) lex.l:235: (Each undeclared identifier is reported
> only once lex.l:235: for each function it appears in.) lex.l: At
> top level:

Moritz.

I had the same problem a few weeks ago. I found at Google that it
seems to be related to an ancient bug in flex.

As a followup:

I've found that current flex version is 2.5.31 in:

http://sourceforge.net/projects/lex/

This is the one being distributed with Debian Unstable. When using
the version included with Debian, I get the same error of Moritz.

I also encountered this same problem yesterday on my Debian system. I
found a way around the problem by modifying lib/db/sqlp/lex.l from
CVS. It turns out that the lex.yy.c file generated from lex.l defines
'YY_FLUSH_BUFFER' at one point, and then undefines it later on, before
its use in the 'yyerror' function. I just manually expanded the macro
in lex.l, and now all is well AFAICT. I'm too lazy right now to
produce a diff, but here's a copy of my lex.l---look around line 233,
I've commented out the original, and inserted my one line
modification.

(attachments)

lex.l (6.43 KB)