[GRASS5] GRASS 5.1 v.in.ascii bug

Markus Neteler neteler at itc.it
Fri May 9 05:48:36 EDT 2003


On Thu, May 08, 2003 at 06:08:05PM +0100, Glynn Clements wrote:
[...]
> The gcc switch -Wimplicit-function-declaration (implied by -Wall) should
> report missing prototypes (use -Werror-implicit-function-declaration to
> make it an error rather than a warning).

Trying this, I got:

gcc -g -Wall -ansi -Werror-implicit-function-declaration  -Wall
-I/ssi0/ssi/neteler/grass51/include
-I/ssi0/ssi/neteler/grass51/dist.i686-pc-linux-gnu/include
-I/ssi0/ssi/neteler/grass51/include
-I/ssi0/ssi/neteler/grass51/dist.i686-pc-linux-gnu/include \
        -o OBJ.i686-pc-linux-gnu/sleep.o -c sleep.c
sleep.c: In function 'time_ltp':
sleep.c:64: storage size of 'tzone' isn't known
sleep.c:64: warning: unused variable zone'
sleep.c: At top level:
/ssi0/ssi/neteler/grass51/include/gis.h:36: warning: RASS_copyright'
defined but not used
make[2]: *** [OBJ.i686-pc-linux-gnu/sleep.o] Error 1
make[2]: Leaving directory /hardmnt/thuille0/ssi/grass51/lib/gis'
make[1]: *** [subdirs] Error 1

Is below a reasonable path?

cvs diff -u sleep.c
Index: sleep.c
===================================================================
RCS file: /grassrepository/grass/src/libes/gis/sleep.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 sleep.c
--- sleep.c     29 Dec 1999 15:10:31 -0000      1.1.1.1
+++ sleep.c     9 May 2003 09:44:30 -0000
@@ -61,9 +61,8 @@
 int time_ltp( double *time)
 {
        struct timeval tstruct;
-       struct timezone tzone;
 
-       gettimeofday (&tstruct, &tzone);
+       gettimeofday (&tstruct, (struct timezone *)NULL);
        *time = tstruct.tv_sec + tstruct.tv_usec / 1000000.0;
        return(0);
 }

-----------------------------

The next error appears in lib/image/open.c which I don't know to fix:

gcc -g -Wall -ansi -Werror-implicit-function-declaration  -Wall
-I/ssi0/ssi/neteler/grass51/include
-I/ssi0/ssi/neteler/grass51/dist.i686-pc-linux-gnu/include
-I/ssi0/ssi/neteler/grass51/include
-I/ssi0/ssi/neteler/grass51/dist.i686-pc-linux-gnu/include \
        -o OBJ.i686-pc-linux-gnu/open.o -c open.c
open.c:29: parse error before 'getshort'
[...]
make[2]: *** [OBJ.i686-pc-linux-gnu/open.o] Error 1
make[2]: Leaving directory /hardmnt/thuille0/ssi/grass51/lib/image'
make[1]: *** [subdirs] Error 1


Maybe someone more C expert than me could spend some time and compile
5.1 with the suggested -Werror-implicit-function-declaration flag...

Markus




More information about the grass-dev mailing list