ed 6d9fc58bbb Improve typing of POSIX search tree functions.
Back in 2015 when I reimplemented these functions to use an AVL tree, I
was annoyed by the weakness of the typing of these functions. Both tree
nodes and keys are represented by 'void *', meaning that things like the
documentation for these functions are an absolute train wreck.

To make things worse, users of these functions need to cast the return
value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to
access the key. Technically speaking such casts violate aliasing rules.
I've observed actual breakages as a result of this by enabling features
like LTO.

I've filed a bug report at the Austin Group. Looking at the way the bug
got resolved, they made a pretty good step in the right direction. A new
type 'posix_tnode' has been added to correspond to tree nodes. It is
still defined as 'void' for source-level compatibility, but in the very
far future it could be replaced by a proper structure type containing a
key pointer.

MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D8205
2016-10-13 18:25:40 +00:00
..
2016-04-30 14:43:42 +00:00
2015-06-13 19:20:56 +00:00
2015-06-13 19:20:56 +00:00
2016-03-04 22:03:38 +00:00
2016-04-30 14:43:42 +00:00
2015-10-13 20:43:49 +00:00
2015-10-13 20:43:49 +00:00
2016-05-30 07:50:57 +00:00
2015-06-16 23:37:19 +00:00
2016-02-29 19:10:32 +00:00
2016-05-31 18:32:57 +00:00
2016-07-28 10:05:41 +00:00
2013-05-25 16:58:12 +00:00
2016-05-30 16:26:34 +00:00
2015-10-13 20:43:49 +00:00