freebsd-dev/lib/libc
Ed Schouten 4ef9bd22ed 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
..
aarch64 Attach the cortex strings library to the build. Only a subset of functions 2016-09-19 15:08:03 +00:00
amd64 Reduce duplicate NOASM and PSEUDO definitions 2016-09-08 22:38:20 +00:00
arm Reduce duplicate NOASM and PSEUDO definitions 2016-09-08 22:38:20 +00:00
capability
compat-43
db hash(3): protect in-memory page when using cross-endianness. 2016-09-26 16:06:50 +00:00
gdtoa
gen Add comment on use of abort() in libc 2016-10-12 13:56:14 +00:00
gmon
i386 Reduce duplicate NOASM and PSEUDO definitions 2016-09-08 22:38:20 +00:00
iconv
include Rewrite ptrace(2) wrappers in C. 2016-08-29 18:47:51 +00:00
inet Update ^/vendor/NetBSD/tests/dist to a more recent snapshot 2016-08-12 01:05:07 +00:00
isc
locale
md
mips Fix strchr, strrchr implementation: convert c to char 2016-10-13 15:23:53 +00:00
nameser
net 'addrlen' does not matter when we need to find the first non-zero bit in 2016-08-31 18:49:50 +00:00
nls Use current locale (f.e. set by thread). It was global locale always 2016-08-24 16:44:27 +00:00
posix1e
powerpc Reduce duplicate NOASM and PSEUDO definitions 2016-09-08 22:38:20 +00:00
powerpc64 Reduce duplicate NOASM and PSEUDO definitions 2016-09-08 22:38:20 +00:00
quad
regex
resolv
riscv Reduce duplicate NOASM and PSEUDO definitions 2016-09-08 22:38:20 +00:00
rpc Update ^/vendor/NetBSD/tests/dist to a more recent snapshot 2016-08-12 01:05:07 +00:00
secure
softfloat
sparc64 Reduce duplicate NOASM and PSEUDO definitions 2016-09-08 22:38:20 +00:00
stdio Fix error handling. 2016-09-05 06:46:04 +00:00
stdlib Improve typing of POSIX search tree functions. 2016-10-13 18:25:40 +00:00
stdtime 1) For already non-standard %z extension implement GNU compatible formats: 2016-09-21 15:47:40 +00:00
string Add timingsafe_bcmp and timingsafe_memcmp. 2016-08-14 23:38:50 +00:00
sys Improve grammar. 2016-10-06 17:35:50 +00:00
tests Improve typing of POSIX search tree functions. 2016-10-13 18:25:40 +00:00
uuid
x86/sys Implement userspace gettimeofday(2) with HPET timecounter. 2016-08-17 09:52:09 +00:00
xdr
yp
libc_nossp.ldscript Add different libc ldscript: the one without libssp -- 2016-10-12 13:19:21 +00:00
libc.ldscript
Makefile Add different libc ldscript: the one without libssp -- 2016-10-12 13:19:21 +00:00
Makefile.depend
Versions.def