[GRASS5] snprintf and other compile errors on IRIX

Glynn Clements glynn.clements at virgin.net
Fri Apr 26 10:59:03 EDT 2002


Paul Kelly wrote:

> > > And the following modules had errors I couldn't fix
> > >
> > > Compilation error in module: src/mapdev/v.in.mif (ignored)
> > >
> > > cc -I/indigo-disk2/grass/grass/src/include -g
> > > -I/indigo-disk2/grass/doom.ee.qub.ac.uk/include   -c lex.yy.c -o
> > > OBJ.mips-sgi-irix6.2/lex.yy.o
> > > cfe: Error: mif.l, line 572: Syntax Error
> > >         {blank} |
> > >         ------^
> > > make: *** [OBJ.mips-sgi-irix6.2/lex.yy.o] Error 1
> > 
> > I'm not sure what it's complaining about here; if you can find out
> > exactly what the error is, I'll commit the fix.
> 
> Still don't have a clue about this, sorry

Try changing the lines:

<*>{whitespace} |
	{blank} |
	  {end}		;

to:

<*>{whitespace} |
<*>{blank}      |
<*>{end}		;

> > > Compilation error in module: src/raster/r.fill.dir (ignored)
> > >
> > > cc -I/indigo-disk2/grass/grass/src/include -g
> > > -I/indigo-disk2/grass/doom.ee.qub.ac.uk/include   -c wtrshed.c -o
> > > OBJ.mips-sgi-irix6.2/wtrshed.o
> > > cfe: Error: wtrshed.c, line 67: missing size for array 'dir'
> > >     struct whereandwhat dir[mxbuf];
> > >  -----------------------^
> > > cfe: Error: wtrshed.c, line 67: storage size for 'dir' isn't known
> > >     struct whereandwhat dir[mxbuf];
> > >  -----------------------^
> > > cfe: Error: wtrshed.c, line 67: Invalid constant expression.
> > >     struct whereandwhat dir[mxbuf];
> > >  ---------------------------^
> > > cfe: Error: wtrshed.c, line 68: missing size for array 'bas'
> > >     struct whereandwhat bas[mxbuf];
> > >  -----------------------^
> > > cfe: Error: wtrshed.c, line 68: storage size for 'bas' isn't known
> > >     struct whereandwhat bas[mxbuf];
> > >  -----------------------^
> > > make: *** [OBJ.mips-sgi-irix6.2/wtrshed.o] Error 1
> > 
> > I don't understand the "storage size" errors; "struct whereandwhat" is
> > defined at the top of that file. But the use of "mxbuf" is a gcc-ism,
> > which I'll fix (by using malloc()).
> > 
> 
> Yes, that fixed it. After wtrshed.c compiled all right I found a
> similar problem in ppupdate.c in the same directory, which I fixed
> as follows using the same syntax as you:

OK; I've fixed that.

> > > Compilation error in module: src/raster/r.in.gdal (ignored)
> > >
> > > cc -L/indigo-disk2/grass/grass/src/libes/LIB.mips-sgi-irix6.2
> > > -L/indigo-disk2/grass/doom.ee.qub.ac.uk/lib -o
> > > /indigo-disk2/grass/grass/dist.mips-sgi-irix6.2/etc/bin/cmd/r.in.gdal
> > > OBJ.mips-sgi-irix6.2/main.o OBJ.mips-sgi-irix6.2/gbgetsymbol.o
> > > OBJ.mips-sgi-irix6.2/gdalbridge.o OBJ.mips-sgi-irix6.2/make_loc.o \
> > >          -lgis -lI -lproj -lm  -lz
> > > ld: ERROR 33: Unresolved text symbol "GBGetSymbol" -- 1st referenced by
> > > OBJ.mips-sgi-irix6.2/gdalbridge.o.
> > > ld: INFO 152: Output file removed because of error.
> > 
> > This suggests that neither
> > 
> >         #if defined(__unix__)
> > nor
> >         #ifdef _WIN32
> > 
> > are true. Can you provide a suitable symbol which could be tested?
> 
> I made the following change to gbgetsymbol.c to get it to work
> 
> 53c53
> < #if defined(__unix__)
> ---
> > #if defined(__unix)

OK; gcc defines both __unix__ and __unix, so I'll use the latter.

> There was also a compile error in src/raster/r.le, which I forgot to
> mention in my earlier e-mail. It involved strings broken over multiple
> lines again, which I fixed by putting backslashes at the end of the
> broken lines.

That will allow the file to compile, but it will mess up the output of
e.g. "r.le.patch help". Instead, I've used e.g.:

   sampling_method->description = "Sampling method (choose only 1 method): \n"
   "\tw = whole map     u = units     m = moving window    r = regions";

> The two files affected were src/raster/r.le/r.le.patch/input.c
> and src/raster/r.le/r.le.pixel/input.c and the diff files for the changes
> are as follows

I've fixed those two files.

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



More information about the grass-dev mailing list