opnsense-src/lib/libc/stdlib
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
..
jemalloc Update jemalloc to 4.2.0. 2016-05-13 04:03:20 +00:00
_Exit.c
a64l.3
a64l.c
abort.3
abort.c
abs.3
abs.c
alloca.3
at_quick_exit.3
atexit.3
atexit.c
atexit.h
atof.3
atof.c
atoi.3
atoi.c
atol.3
atol.c
atoll.c
bsearch.3
bsearch.c
bsearch_b.c
cxa_thread_atexit.c Add __cxa_thread_atexit(3) API implementation. 2016-08-06 13:32:40 +00:00
div.3
div.c Don't use fixup for C99 and up, the compiler result is already correct. 2016-06-01 10:14:25 +00:00
exit.3
exit.c Add __cxa_thread_atexit(3) API implementation. 2016-08-06 13:32:40 +00:00
getenv.3
getenv.c
getopt.3
getopt.c
getopt_long.3
getopt_long.c
getsubopt.3
getsubopt.c
hcreate.3
hcreate.c
hcreate_r.c
hdestroy_r.c
heapsort.c libc: spelling fixes. 2016-04-30 01:24:24 +00:00
heapsort_b.c
hsearch.h
hsearch_r.c
imaxabs.3
imaxabs.c
imaxdiv.3
imaxdiv.c Don't use fixup for C99 and up, the compiler result is already correct. 2016-06-01 10:14:25 +00:00
insque.3
insque.c
l64a.c Let l64a() properly null terminate its result. 2016-05-26 20:55:15 +00:00
labs.3
labs.c
ldiv.3
ldiv.c Don't use fixup for C99 and up, the compiler result is already correct. 2016-06-01 10:14:25 +00:00
llabs.3
llabs.c
lldiv.3
lldiv.c Don't use fixup for C99 and up, the compiler result is already correct. 2016-06-01 10:14:25 +00:00
lsearch.3
lsearch.c
Makefile.inc When MAKEOBJDIRPREFIX points to a case-insensitive file system, the 2016-09-16 03:04:48 +00:00
memory.3
merge.c
mergesort_b.c
ptsname.3
ptsname.c
qsort.3
qsort.c
qsort_r.c
quick_exit.3
quick_exit.c
radixsort.3
radixsort.c
rand.3
rand.c 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes 2016-05-29 13:57:06 +00:00
random.3 Fix typing of srandom() and initstate(). 2016-07-26 20:11:29 +00:00
random.c Add comment on use of abort() in libc 2016-10-12 13:56:14 +00:00
reallocarray.3
reallocarray.c
reallocf.3
reallocf.c
realpath.3
realpath.c
remque.c
strfmon.3
strfmon.c libc: spelling fixes. 2016-04-30 01:24:24 +00:00
strtod.3
strtoimax.c
strtol.3
strtol.c
strtoll.c
strtonum.3
strtonum.c
strtoq.c
strtoul.3
strtoul.c
strtoull.c
strtoumax.c
strtouq.c
Symbol.map Add __cxa_thread_atexit(3) API implementation. 2016-08-06 13:32:40 +00:00
system.3
system.c
tdelete.c Improve typing of POSIX search tree functions. 2016-10-13 18:25:40 +00:00
tfind.c Improve typing of POSIX search tree functions. 2016-10-13 18:25:40 +00:00
tsearch.3 Improve typing of POSIX search tree functions. 2016-10-13 18:25:40 +00:00
tsearch.c Improve typing of POSIX search tree functions. 2016-10-13 18:25:40 +00:00
tsearch_path.h
twalk.c Improve typing of POSIX search tree functions. 2016-10-13 18:25:40 +00:00