Fwd: Re: [GRASS5] New MacOS X compilation errors

Eric G . Miller egm2 at jps.net
Sat Dec 2 14:41:38 EST 2000


On Sat, Dec 02, 2000 at 12:39:13AM -0800, Jeshua Lacock wrote:
> I just updated the entire tree and In order to compile connect.c, I
> had to move connect.c.orig to connect.c. The errors I got were a bunch
> of messages like  "connect.c:73: illegal expression, found `<<'"  (I
> have a hunch that it is checked out our something...).
> 
> I got some errors  about malloc and realloc, so I deleted line 1369 in
> SWITCHER.c to get it working.

If there are << "sometext" or >> "sometext", that means there was a
problem with the cvs merge.  This can usually be fixed by simply
deleting the file then run "cvs -z3 update -d [somefile]" which will
fetch a fresh copy.  In general, if you go around editing files and then
do a cvs update it's likely to cause these problems if someone else has
edited those files since you last did an update.  The line number
offsets 'diff' uses will no longer be valid for the merge operation.

Deleting lines that have malloc/realloc is never a good thing either, as
you've just removed a probably critical memory allocation function call.
The program may compile, but is likely to get a SIGSEGV somewhere during
it's execution when it tries to access a NULL pointer or memory that
isn't allocated.  malloc/realloc should be defined in the header
<stdlib.h> and always be part of libc.  It's possible the offending file
did not '#include <stdlib.h>' which may not be a problem on some
systems, but is on others.  The solution would be to make sure that
header include statement is at the top of the file.  But, actually I
guess it was decided to always use the G_malloc, G_calloc and G_realloc
wrappers that are defined in "gisdefs.h" which is included by "gis.h".
So perhaps these function calls need to be changed????

-- 
Eric G. Miller <egm2 at jps.net>

---------------------------------------- 
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