[GRASS5] snprintf and other compile errors on IRIX
Glynn Clements
glynn.clements at virgin.net
Fri Apr 26 11:09:06 EDT 2002
Eric G. Miller wrote:
> > I made the following change to gbgetsymbol.c to get it to work
> >
> > 53c53
> > < #if defined(__unix__)
> > ---
> > > #if defined(__unix)
> >
> > Extract from IRIX cc man page:
>
> Problem is, these symbols are compiler specific. It is definitely
> __unix__ for gcc, but all __<foo> symbols are reserved for the
> implementation (i.e. platform specific).
AFAIK, gcc defines both. To be on the safe side, I've changed the
check to:
#if defined(__unix) || defined(__unix__)
> > 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. 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
>
> [snip]
>
> Hmm. Those still seem wrong. I'm guessing what is wanted is:
>
> foo = "Some line of text.\n"\
> "\tAnother line of text with a leading tab character.\n";
Yep, although you don't need the backslash.
> Quotes should not be broken across lines. It is not the right way to
> embed newlines (this isn't Perl or sh ...) since the compiler will
> probably strip those newlines when parsing the code.
Yep.
> > So if all the snprintf() calls have been removed, v.in.mif
> > is now the only module not compiling on IRIX 6.2 (out
> > of those enabled in src/CMD/lists/GRASS of course). My
> > next big challenge is to get SG3d working with GRASS 5 (I
> > currently only have the non-floating point version working
> > with GRASS 4.3).
>
> There're still some instances of snprintf()...
Should I add a stub implementation to libgis?
In any case, I'll add a configure check.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev
mailing list