[GRASS5] New MacOS X compilation errors

Justin Hickey jhickey at hpcc.nectec.or.th
Mon Nov 20 00:31:23 EST 2000


Hi Andreas

Andreas Lange wrote:
> generally all modules should use the available G_* functions instead
> of the system functions. I already changed some calls in some
> libraries and modules.
> Other functions than G_malloc are:
> G_strcasecmp
> G_strcmp
> etc, etc. (can prepare a list if there is interest).

Hmmm. First of all G_strcmp does not exist. Secondly, I just looked at
the file src/libes/gis/strings.c and IMHO I think all the functions in
this file should be scrapped, except for G_strcasecmp. All the other
functions simply do the same as the standard string library functions or
do things which I consider very dangerous. For those that do the same as
the standard string library I see no reason why we shouldn't use the
standard library. For those that are dangerous (like G_strmov which
copies a string without a null terminator) I see no use for them at all.
In fact I see them causing more problems than anything.

Perhaps some of the src/libes/gis functions should be reviewed to see if
they are necessary. For example, G_malloc and the other allocation
functions are good to have since they ensure that memory is allocated
correctly. But the strings.c file has only one function that is useful
as far as I can see.

In general, I guess we should have a good reason to maintain functions
that call or replace standard library functions. Am I missing something
with the strings.c file? Are there any reasons to keep these functions?

Just my 2 cents worth.

-- 
Sincerely,

Jazzman (a.k.a. Justin Hickey)  e-mail: jhickey at hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do.  ---Anonymous

Jazz and Trek Rule!!!
==================================================================

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