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

Ivan Shmakov oneingray at gmail.com
Tue Sep 8 10:45:56 EDT 2009


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.

xround.c:24: warning: conflicting types for built-in function 'round'

	Seems to be harmless, though may easily be silenced by, like:

--- raster/r.mapcalc/xround.c	2009-09-08 19:14:19.000000000 +0700
+++ raster/r.mapcalc/xround.c	2009-09-08 21:37:03.537188857 +0700
@@ -8,7 +8,7 @@
 #include "func_proto.h"
 
 /**********************************************************************
-round(x)
+i_round(x)
 
   rounds x to nearest integer.
 
@@ -19,9 +19,9 @@
   numbers, and subtracting .5 from negatives.
 **********************************************************************/
 
-/* round(x) rounds x to nearest CELL value, handles negative correctly */
+/* i_round(x) rounds x to nearest CELL value, handles negative correctly */
 
-static int round(double x)
+static int i_round(double x)
 {
     int n;
 
@@ -77,7 +77,7 @@
 		if (IS_NULL_F(&arg1[i]))
 		    SET_NULL_C(&res[i]);
 		else
-		    res[i] = round(arg1[i]);
+		    res[i] = i_round(arg1[i]);
 	    return 0;
 	}
     case DCELL_TYPE:
@@ -88,7 +88,7 @@
 		if (IS_NULL_D(&arg1[i]))
 		    SET_NULL_C(&res[i]);
 		else
-		    res[i] = round(arg1[i]);
+		    res[i] = i_round(arg1[i]);
 	    return 0;
 	}
     default:

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
pv.h:33: warning: its scope is only this definition or declaration, which is probably not what you want
pv.h:33: warning: 'struct Colors' declared inside parameter list
pv.h:33: warning: its scope is only this definition or declaration, which is probably not what you want

	Needs #include <grass/raster.h>.

--- raster/r.out.vrml/pv.h	2009-09-08 19:14:16.000000000 +0700
+++ raster/r.out.vrml/pv.h	2009-09-08 21:43:16.353402293 +0700
@@ -1,4 +1,5 @@
 #include <grass/gis.h>
+#include <grass/raster.h>
 
 /*  VRML VERSION - only 1.0 currently supported
    #define VRML2

make[2]: Entering directory `/var/home/ivan/devel/grass-trunk-r39080/raster/r.statistics'
method.h:33: warning: 'struct Categories' declared inside parameter list
method.h:33: warning: its scope is only this definition or declaration, which is probably not what you want
method.h:36: warning: 'struct Categories' declared inside parameter list
method.h:42: warning: 'struct Categories' declared inside parameter list
method.h:45: warning: 'struct Categories' declared inside parameter list
method.h:48: warning: 'struct Categories' declared inside parameter list
method.h:51: warning: 'struct Categories' declared inside parameter list
method.h:54: warning: 'struct Categories' declared inside parameter list
method.h:57: warning: 'struct Categories' declared inside parameter list
method.h:60: warning: 'struct Categories' declared inside parameter list
method.h:63: warning: 'struct Categories' declared inside parameter list
method.h:66: warning: 'struct Categories' declared inside parameter list
method.h:69: warning: 'struct Categories' declared inside parameter list

	Likewise.

--- 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>
+
 #define DISTRIB 0
 #define AVERAGE 1
 #define MODE    2

	Unless there are to be objections, I'm going to commit the
	changes above to the trunk.

-- 
FSF associate member #7257


More information about the grass-dev mailing list