System V tsearch snafu

Doug Gwyn gwyn at smoke.BRL.MIL
Mon Jan 23 14:44:52 AEST 1989


The description in the SVR3.0 PRM for the "rootp" etc. pointer types,
and the library source code, for tsearch(3C) and related functions is
all bollixed up.  This is also specified wrong in the SVID.

"root" should be of generic pointer type (char * or void *), and the
implementation of tsearch() etc. should coerce this into NODE * for
internal use.  There is no way for the application to specify NODE *
as the current implementation would technically require.

The reason these routines happen to have worked is that on most systems
AT&T "supports", all pointers have the same representation.  This is
definitely not true of all systems in existence, however, so the types
should be gotten correct.

The only pointer representation equivalence required by the proposed
ANSI C standard is between void * and char *, not NODE *.



More information about the Comp.bugs.sys5 mailing list