[GRASS5] Status of 5.0.0 release
Glynn Clements
glynn.clements at virgin.net
Tue Apr 10 08:40:09 EDT 2001
Michel Wurtz wrote:
> > > Do you want the qsort() warnings fixed? AFAICT, all of these arise
> > > from comparison functions taking pointers to the actual object type,
> > > but qsort() having a fixed prototype with a fixed 4th parameter.
> > >
> > > Fixing them is basically a choice of either:
> > >
> > > a) changing e.g.:
> > >
> > > int compare(foo *a, foo *b)
> > > {
> > > return CMP(*a, *b);
> > > }
> > > to
> > > int compare(void *aa, void *bb)
> > > {
> > > foo *a = (foo*) aa;
> > > foo *b = (foo*) bb;
> > > return CMP(*a, *b);
> > > }
> > >
> > > or:
> > >
> > > b) explicitly casting the 4th argument to qsort()
> [...]
> > this I would like to put into general discussion. Maybe we can silently
> > ignore the qsort warnings (no problems in past)?
>
> I like a compile process without warning... The b) solution seems easier,
> and probably more understandable (even more with a comment line ;-),
> but does it really suppress warnings ?
Good point. IIRC, casting function pointers (either explicitly or
implicitly) isn't 100% legal.
Also, many people seem to have problems reading function types (Linux'
signal(2) manpage even includes an explanation of how to read the
declaration of the second parameter).
--
Glynn Clements <glynn.clements at virgin.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