<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/tests/stdlib, branch release/14.4.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F14.4.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F14.4.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2025-12-03T02:34:33Z</updated>
<entry>
<title>strfmon: Fix negative sign handling for C locale</title>
<updated>2025-12-03T02:34:33Z</updated>
<author>
<name>Jose Luis Duran</name>
<email>jlduran@FreeBSD.org</email>
</author>
<published>2025-11-26T20:34:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1869d604e22d88c8c7487cd8a547de42847a40be'/>
<id>urn:sha1:1869d604e22d88c8c7487cd8a547de42847a40be</id>
<content type='text'>
If the locale's positive_sign and negative_sign values would both be
returned by localeconv() as empty strings, strfmon() shall behave as if
the negative_sign value was the string "-".

This occurs with the C locale.  The implementation previously assigned
"0" to sign_posn (parentheses around the entire string); now it assigns
it to "1" (sign before the string) when it is undefined (CHAR_MAX).

Austin Group Defect 1199[1] is applied, changing the requirements for
the '+' and '(' flags.

[1]: https://www.austingroupbugs.net/view.php?id=1199

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D53913

(cherry picked from commit cf85e7034ad5640b18a3b68d6b291b7bf89bfc80)
</content>
</entry>
<entry>
<title>strfmon: EINVAL if the '+' flag and both signs are empty</title>
<updated>2025-12-03T02:34:21Z</updated>
<author>
<name>Jose Luis Duran</name>
<email>jlduran@FreeBSD.org</email>
</author>
<published>2025-11-26T20:34:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8dc8e3011d05bdadb3e62fe99fbb054e33bfd8f2'/>
<id>urn:sha1:8dc8e3011d05bdadb3e62fe99fbb054e33bfd8f2</id>
<content type='text'>
According to the Open Group Base Specifications Issue 8[1], strfmon(3)
should return EINVAL when the '+' flag was included in a conversion
specification and the locale's positive_sign and negative_sign values
would both be returned by localeconv(3) as empty strings.

Austin Group Defect 1199[2] is applied, adding the [EINVAL] error.

[1]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/strfmon.html
[2]: https://www.austingroupbugs.net/view.php?id=1199

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D53912

(cherry picked from commit 1fd018972a18b682521bb8f004dfd162327e5db2)
</content>
</entry>
<entry>
<title>strfmon: Add tests for Austin Group Defect 1199</title>
<updated>2025-12-03T02:34:09Z</updated>
<author>
<name>Jose Luis Duran</name>
<email>jlduran@FreeBSD.org</email>
</author>
<published>2025-11-26T20:34:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7745ece2819e3613308974c5c547b7d1218b3856'/>
<id>urn:sha1:7745ece2819e3613308974c5c547b7d1218b3856</id>
<content type='text'>
Add tests for The Open Group Base Specifications Issue 8[1], Austin
Group Defect 1199[2].

Items marked with XXX represent an invalid output.  These items will be
fixed in subsequent commits.

Notice that an existing test is now considered invalid.

Our locale definitions do not include int_p_sep_by_space nor
int_n_sep_by_space[3].  Those will be addressed in a subsequent commit.
However, the CLDR project defines them as "0", which causes the output
to appear as "USD123.45".  If our locale definitions were to set the
international {n,p}_sep_by_space to "1", the output would display as the
expected "USD 123.45".

While here, use the SPDX license identifier and add my name to the
file.

[1]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/strfmon.html
[2]: https://www.austingroupbugs.net/view.php?id=1199
[3]: https://unicode-org.atlassian.net/browse/CLDR-237

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D53911

(cherry picked from commit 19e153004fb63c32eba0ef40249f5ede61a93170)
</content>
</entry>
<entry>
<title>libc: Drop incorrect qsort optimization</title>
<updated>2025-08-27T18:49:58Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-08-15T07:22:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f1e93df44ba0b494c6eda01958a71fec501bc32b'/>
<id>urn:sha1:f1e93df44ba0b494c6eda01958a71fec501bc32b</id>
<content type='text'>
As pointed out in the PR and the article linked below, the switch to
insertion sort in the BSD qsort code is based on a misunderstanding of
Knuth's TAOCP and is actually a pessimization.  As demonstrated by the
added test, it is trivially easy to construct pathological input which
results in quadratic runtime.  Without that misguided optimization, the
same input runs in nearly linearithmic time.

https://www.raygard.net/2022/02/26/Re-engineering-a-qsort-part-3

PR:		287089
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D51907

(cherry picked from commit 5205b32de3fb7702e96b3991f5b1a61eee406d8b)
</content>
</entry>
<entry>
<title>libc: tests: add some tests for __cxa_atexit handling</title>
<updated>2025-04-17T01:01:46Z</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-04-05T00:47:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=df4b8eff7b19311f6cc5c339aebb41ecafd2e52c'/>
<id>urn:sha1:df4b8eff7b19311f6cc5c339aebb41ecafd2e52c</id>
<content type='text'>
This adds a basic test that __cxa_atexit works, and also adds some tests
for __cxa_atexit handlers registered in the middle of __cxa_finalize.

PR:		285870

(cherry picked from commit ee9ce1078c596f5719f312feedd616ab0fb41dc9)
</content>
</entry>
<entry>
<title>pkgbase: install all libc test files into the tests package</title>
<updated>2024-03-27T08:37:10Z</updated>
<author>
<name>Baptiste Daroussin</name>
<email>bapt@FreeBSD.org</email>
</author>
<published>2024-03-20T16:13:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=77205dbc1397acbe415dad26732dfdb6f62b0def'/>
<id>urn:sha1:77205dbc1397acbe415dad26732dfdb6f62b0def</id>
<content type='text'>
(cherry picked from commit 3a9ddfa1ab46b492c861022ea254b3277ef74dde)
</content>
</entry>
<entry>
<title>libc: Purge unneeded cdefs.h</title>
<updated>2023-11-27T04:20:09Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-11-01T22:43:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4025b5b527c870cf095ac9531764f4e4d3feaec2'/>
<id>urn:sha1:4025b5b527c870cf095ac9531764f4e4d3feaec2</id>
<content type='text'>
These sys/cdefs.h are not needed. Purge them. They are mostly left-over
from the $FreeBSD$ removal. A few in libc are still required for macros
that cdefs.h defines. Keep those.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D42385

(cherry picked from commit 559a218c9b257775fb249b67945fe4a05b7a6b9f)
</content>
</entry>
<entry>
<title>libc: Rewrite quick_exit() and at_quick_exit() using C11 atomics.</title>
<updated>2023-10-04T23:59:43Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2023-09-26T20:06:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b9c361e4af26547b7a373d5dda4eb7a6fee4f7c6'/>
<id>urn:sha1:b9c361e4af26547b7a373d5dda4eb7a6fee4f7c6</id>
<content type='text'>
Compiler memory barriers do not prevent the CPU from executing the code
out of order.  Switch to C11 atomics.  This also lets us get rid of the
mutex; instead, loop until the compare_exchange succeeds.

While here, change the return value of at_quick_exit() on failure to
the more traditional -1, matching atexit().

Sponsored by:	Klara, Inc.
Reviewed by:	Olivier Certner, kevans, kib
Differential Revision:	https://reviews.freebsd.org/D41936

(cherry picked from commit 1dc3abb052430279e47c8922d22b30922adcf0f6)

libc: Add a rudimentary test for quick_exit(3).

Sponsored by:	Klara, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D41937

(cherry picked from commit c7dd4601aeebbc1bbe131cbe6747476c124b47fe)
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line sh pattern</title>
<updated>2023-08-16T17:55:03Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:55:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf'/>
<id>urn:sha1:d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf</id>
<content type='text'>
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:42Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1d386b48a555f61cb7325543adbbb5c3f3407a66'/>
<id>urn:sha1:1d386b48a555f61cb7325543adbbb5c3f3407a66</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
</entry>
</feed>
