Path: utzoo!attcan!uunet!husc6!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.bugs.sys5 Subject: System V tsearch snafu Keywords: System V UNIX C library tsearch tree search bug Message-ID: <9481@smoke.BRL.MIL> Date: 23 Jan 89 04:44:52 GMT Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 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 *.