[GRASS-dev] suspicious warnings while compiling GRASS trunk (r39080)

Glynn Clements glynn at gclements.plus.com
Fri Sep 11 23:46:49 EDT 2009


Ivan Shmakov wrote:

> make[2]: Entering directory `/var/home/ivan/devel/grass-trunk-r39080/raster/r.mapcalc'
> map.c:344: warning: cast to pointer from integer of different size
> 
> 	Not quite sure about this one.

This is a bug, introduced in r38099, along with simlar bugs affecting
d.legend and r.to.vect.

G_get_cat() took a CELL argument (so FCELL or DCELL arguments will be
implicitly cast).

Rast_get_c_cat() takes a CELL* and Rast_get_cat() takes a void*. 
Passing the value itself is an error, as is passing a pointer to the
wrong numeric type.

It appears that calls to G_get_cat() were initially replaced with
Rast_get_cat(). This will produce errors due to the wrong number of
arguments (Rast_get_cat() also needs a RASTER_MAP_TYPE argument). So
it was changed to Rast_get_c_cat(), which has the right number of
arguments, but the wrong types, hence the errors.

I've fixed these specific cases with r39133, but I can't rule out the
possibility that others may have been hidden by casts.

> xround.c:24: warning: conflicting types for built-in function 'round'
> 
> 	Seems to be harmless, though may easily be silenced by, like:

Done in r39130, except:

>  /**********************************************************************
> -round(x)
> +i_round(x)

This is the name of the r.mapcalc function which the file implements,
so shouldn't be changed.

> make[2]: Entering directory `/var/home/ivan/devel/grass-trunk-r39080/raster/r.out.vrml'
> pv.h:33: warning: 'struct Colors' declared inside parameter list

> 	Needs #include <grass/raster.h>.

Fixed in r39131, plus some clean-up.

> --- raster/r.statistics/method.h	2009-09-08 19:14:04.000000000 +0700
> +++ raster/r.statistics/method.h	2009-09-08 21:43:54.983370151 +0700
> @@ -1,3 +1,5 @@
> +#include <grass/raster.h>

Fixed in r39132 (also <stdio.h> for FILE).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list