[GRASSLIST:4686] Re: malloc alloc conflicting types in alloc.c in dbmi

Glynn Clements glynn at gclements.plus.com
Fri Oct 29 04:10:52 EDT 2004


francesco.pirotti wrote:

> when compiling the first error module with gmake53 I get the following error 
> stating that the malloc and alloc declaration in the first lines of the file 
> alloc.c is of conflicting types.
> 
> alloc.c:4: error: conflicting types for 'malloc'
> alloc.c:4: error: conflicting types for 'malloc'
> alloc.c:5: error: conflicting types for 'calloc'
> alloc.c:5: error: conflicting types for 'calloc'
> make[1]: *** [OBJ.i686-pc-linux-gnu/alloc.o] Error 1
> make[1]: Leaving directory `/usr/local/grass-5.3.0/src/libes/dbmi/lib'
> make: *** [all] Error 2
> 
> The first lines of alloc.c are:
> 
> #include "dbmi.h"
> #include <string.h>
> 
> extern char *malloc();
> extern char *calloc();
> extern char *realloc(); 

It should include <stdlib.h> rather than supplying its own (incorrect)
declarations.

I've fixed this in CVS.

> Can it be something to do with stdc++ libraries?

Not unless you're trying to compile GRASS with a C++ compiler. Most of
GRASS is written in C; r.terraflow is the only module which is written
in C++, and that's only compiled if you use the --with-cxx switch.

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




More information about the grass-user mailing list