opnsense-src/lib/libc/stdlib
Dimitry Andric ef314cd4ba Fix null pointer subtraction in mergesort()
Clang 13 produces the following warning for this function:

lib/libc/stdlib/merge.c:137:41: error: performing pointer subtraction with a null pointer has undefined behavior [-Werror,-Wnull-pointer-subtraction]
        if (!(size % ISIZE) && !(((char *)base - (char *)0) % ISIZE))
                                               ^ ~~~~~~~~~

This is meant to check whether the size and base parameters are aligned
to the size of an int, so use our __is_aligned() macro instead.

Also remove the comment that indicated this "stupid subtraction" was
done to pacify some ancient and unknown Cray compiler, and which has
been there since the BSD 4.4 Lite Lib Sources were imported.

(cherry picked from commit 4e5d32a445)
2021-08-31 21:05:43 +02:00
..
jemalloc Follow-up r365371 by removing sentences which indicate the state of the 2020-09-06 09:08:06 +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 Fix order of destructors between main binary and libraries. 2019-04-15 13:03:09 +00:00
atexit.h
atof.3 Note some functions that appeared in First Edition Unix 2020-04-01 22:50:41 +00:00
atof.c
atoi.3 Note some functions that appeared in First Edition Unix 2020-04-01 22:50:41 +00:00
atoi.c
atol.3
atol.c
atoll.c
bsearch.3 bsearch.3: Improve the example. 2019-07-17 19:29:55 +00:00
bsearch.c libc: typo fix (s/involes/involves) 2020-10-16 17:51:09 +00:00
bsearch_b.c
cxa_thread_atexit.c
cxa_thread_atexit_impl.c
div.3
div.c
exit.3 _Exit(3): document implementation 2021-08-12 15:37:54 +03:00
exit.c
getenv.3
getenv.c
getopt.3
getopt.c getopt: Fix conversion from string-literal to non-const char * 2021-01-19 21:23:25 +00:00
getopt_long.3 Fix a typo: argments -> arguments 2020-05-19 11:05:27 +00:00
getopt_long.c getopt: Fix conversion from string-literal to non-const char * 2021-01-19 21:23:25 +00:00
getsubopt.3
getsubopt.c
hcreate.3
hcreate.c
hcreate_r.c
hdestroy_r.c
heapsort.c
heapsort_b.c
hsearch.h
hsearch_r.c
imaxabs.3
imaxabs.c
imaxdiv.3
imaxdiv.c
insque.3
insque.c
l64a.c
labs.3
labs.c
ldiv.3
ldiv.c
llabs.3
llabs.c
lldiv.3
lldiv.c
lsearch.3
lsearch.c
Makefile.inc Implement ptsname_r. 2020-10-17 04:14:38 +00:00
memory.3
merge.c Fix null pointer subtraction in mergesort() 2021-08-31 21:05:43 +02:00
mergesort_b.c
ptsname.3 Implement ptsname_r. 2020-10-17 04:14:38 +00:00
ptsname.c Further refinements of ptsname_r(3) interface: 2020-10-20 01:29:45 +00:00
qsort.3 qsort.3: Bump Dd and note that Annex K is optional 2020-01-20 18:43:10 +00:00
qsort.c libc/qsort: Don't allow interposing recursive calls 2021-03-17 09:46:58 +00:00
qsort_r.c
qsort_s.c Add qsort_s(3). Apart from the constraints, it also makes it easier 2020-01-20 11:40:07 +00:00
quick_exit.3
quick_exit.c
radixsort.3
radixsort.c
rand.3 rand(3): Replace implementation with one backed by random(3) algorithm 2020-02-01 20:33:23 +00:00
rand.c Fix race between first rand(3) calls with _once(). 2021-08-18 21:11:51 -04:00
random.3 rand(3): Replace implementation with one backed by random(3) algorithm 2020-02-01 20:33:23 +00:00
random.c rand(3): Replace implementation with one backed by random(3) algorithm 2020-02-01 20:33:23 +00:00
random.h rand(3): Replace implementation with one backed by random(3) algorithm 2020-02-01 20:33:23 +00:00
reallocarray.3
reallocarray.c
reallocf.3
reallocf.c Regularize my copyright notice 2019-12-04 16:56:11 +00:00
realpath.3
realpath.c vfs: add realpathat syscall 2020-02-20 16:58:19 +00:00
remque.c
set_constraint_handler_s.3 Provide set_constraint_handler_s(3) man page. 2018-08-19 14:39:57 +00:00
set_constraint_handler_s.c
strfmon.3
strfmon.c Compute the correct size of the string to move forward. 2020-09-02 20:04:26 +00:00
strtod.3
strtoimax.c
strtol.3
strtol.c
strtold.c
strtoll.c
strtonum.3
strtonum.c
strtoq.c
strtoul.3
strtoul.c
strtoull.c
strtoumax.c
strtouq.c
Symbol.map Further refinements of ptsname_r(3) interface: 2020-10-20 01:29:45 +00:00
system.3 libc: Fix most issues reported by mandoc 2020-12-19 14:54:28 +00:00
system.c
tdelete.c
tfind.c
tsearch.3
tsearch.c
tsearch_path.h
twalk.c