[GRASS5] pointer problems

David D Gray ddgray at armadce.demon.co.uk
Sun Sep 24 12:47:30 EDT 2000


Markus

I have uploaded a quick fix for the pointer argument problem in
v.in.shape. I just cast the argument to that of the called function ie.
void ** here.

This seems to be due to the fact that void* or higher levels of
indirection will sometimes refer to values that are themselves pointers,
in this case void ** resolves to pntDescript * - so ultimately
pntDescript***.

Some compilers warn, but allow the compilation, so that the programmer
will have to manually resolve any errors, others seem to dissallow it
and demand precise pointer and indirection equivalence. The former is
the one I had been working to, but perhaps we should always cast in
future (actually I haven't tested this on the problem platform (Cray),
which I don't have access to, does it work?). 

As pointed out in a previous posting, this can be dangerous in general,
but really is unavoidable for certain data types. Just debug using a
good malloc debugger with memory mapping and protection enabled.

More compile errors are likely to arise. perhaps it's best if those who
have access to the Cray can make the appropriate casts.

David

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list