r.mapcalc compile trouble - was Re: [GRASS5] I18N for GRASS: continued discussion

Glynn Clements glynn.clements at virgin.net
Mon Nov 18 23:33:38 EST 2002


Scott W Mitchell wrote:

> Any chance there was a typo in that fix that some compilers don't mind, 
> but mine does ?

Nope; the latest change to that file only affected lines 131 onwards.
There is a problem, but it was present as far back as -pre4.

> I was very excited to read that the history is back in, so updated my 
> source code and tried compiling.  On a linux/debian/AMD box, I got the 
> following error when it was working on mapcalc3:
> 
> #################################################################
> /usr/local/src/grass/src/raster/r.mapcalc3
>    make -f OBJ.i686-pc-linux-gnu/make.rules
> 
> bison -y -d mapcalc.y
> mapcalc.y:75.8: parse error, unexpected ":", expecting ";" or "|"
> make: *** [y.tab.c] Error 1
> 
> I've looked at that line and the preceding ones in the source, and 
> don't see anything obvious, but then again I don't have a clue how 
> bison and friends work, so I'm just comparing to other lines in the 
> same file.

AFAICT, the problem is that the previous rule isn't terminated with a
semicolon. It appears that my version of bison[1] doesn't care about
this, but yours does.

[1] Not only my version, but that of everyone else who has compiled
any version of GRASS since at least -pre4; byacc (Berkeley yacc)
doesn't care either.

I'm about to commit a fix to this, which essentially just adds a line
containing an indented semicolon at line 74:

program		: stmts			{ $$ = result = $1;		}
		;

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list