[GRASS-dev] [bug #4987] (grass) malloc errors/declaration - 64 bit problems

Glynn Clements glynn at gclements.plus.com
Tue Aug 8 13:43:12 EDT 2006


Request Tracker wrote:

> this bug's URL: http://intevation.de/rt/webrt?serial_num=4987

> Subject: malloc errors/declaration - 64 bit problems
> 
> grass obtained from: CVS
> grass binary for platform: Compiled from Sources
> 
> Copied to bugtracker by MN.
> -------
> 
> On Tue, Aug 08, 2006 at 04:10:04PM +0200, Roberto Flor wrote:
> Here my findings on 64 bit problems:
> 
> Simple, potential error on 64 bit machines, really only for float case:
> 
> ./raster/simwe/r.sim.sediment/main.c:   si = (double **)G_malloc (sizeof(double)*(my));
> ./raster/simwe/r.sim.sediment/main.c:   sigma = (double **)G_malloc (sizeof(double)*(my));
> ./raster/simwe/r.sim.sediment/main.c:        dif = (float **)G_malloc (sizeof(float)*(my));
> ./raster/simwe/r.sim.sediment/main.c:        er = (float **)G_malloc (sizeof(float)*(my));
> ./vector/v.surf.idw/main.c:    npoints_currcell = (long **)G_malloc(window.rows * sizeof(long));

> ./vector/v.surf.idw/main.c:        search_list = (struct cell_list **)G_malloc(max_radius * sizeof(struct cell_list));
> ./vector/v.surf.idw/main.c:        search_list_start = (struct cell_list **)G_malloc(max_radius * sizeof(struct cell_list));
> ./vector/v.surf.idw/main.c:    points = (struct Point ***)G_malloc(window.rows * sizeof(struct Point));
> ./vector/v.surf.idw/main.c:        points[row] = (struct Point **)G_malloc(window.cols * sizeof(struct Point));
> 
> In all the case the sizeof shoul to be of a pointer.

I've fixed these in CVS.

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




More information about the grass-dev mailing list