Hi Glynn, 2008/10/1 Glynn Clements <[EMAIL PROTECTED]>: > > Yann Chemin wrote: > >> > Right; you need <unistd.h> for swab(). >> >
see below about this >> are there forgiving compilers around, so that this was not required >> explicitely? > > By default, "implicit declaration of function ..." only generates a > warning, not an error. However, the resulting binary is likely to > crash if the compiler guesses the function's prototype incorrectly. > > IIRC, Markus normally compiles with > -Werror-implicit-function-declaration, which will cause implicit > function definitions to generate an error. > I have made that my default compile option now. >> > Also, the fact that the swab() calls are there seems to imply that the >> > data was imported incorrectly in the first place. If any byte swapping >> > needs to be done, it should normally be done when the data is >> > imported. >> > >> My mastering of binary reading is weak, so I guess you make sense, >> but technically I would feel weak to modify it. For what I undestand >> it was initially meant (outside of GRASS) to isolate a small number >> of bits for & comparison. > > In that case, I'm guessing that the code was designed for a specific > architecture, one whose byte order is opposite to that used by the > data. > > Ultimately, if you don't understand the format, or how the code is > supposed to work, it's probably better not to commit it. > I agree. Let me try to remove swab(). It should help clarify things. > -- > Glynn Clements <[EMAIL PROTECTED]> > Thanks for all, Yann -- Yann Chemin International Rice Research Institute Office: http://www.irri.org/gis Perso: http://www.freewebs.com/ychemin YiKingDo: http://yikingdo.unblog.fr/ _______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev