<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc/tests/stdlib/Makefile, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>system(3): Write our own tests</title>
<updated>2026-02-25T21:12:29+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2026-02-25T21:12:29+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=7a1ade5109ac57d1f59eaa75b5d0f13fabecf6ba'/>
<id>7a1ade5109ac57d1f59eaa75b5d0f13fabecf6ba</id>
<content type='text'>
Replace the somewhat perfunctory NetBSD tests with our own.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	bnovkov, kevans
Differential Revision:	https://reviews.freebsd.org/D55482
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace the somewhat perfunctory NetBSD tests with our own.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	bnovkov, kevans
Differential Revision:	https://reviews.freebsd.org/D55482
</pre>
</div>
</content>
</entry>
<entry>
<title>libc: Drop incorrect qsort optimization</title>
<updated>2025-08-15T07:23:03+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-08-15T07:22:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5205b32de3fb7702e96b3991f5b1a61eee406d8b'/>
<id>5205b32de3fb7702e96b3991f5b1a61eee406d8b</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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>libc: Add getenv_r() function.</title>
<updated>2025-04-27T06:29:32+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-04-27T06:29:10+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=873420ca1e6e8a2459684f5b5d3e557a8ef75928'/>
<id>873420ca1e6e8a2459684f5b5d3e557a8ef75928</id>
<content type='text'>
This is a calque of the NetBSD function of the same name.

MFC after:	never
Relontes:	yes
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D49979
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a calque of the NetBSD function of the same name.

MFC after:	never
Relontes:	yes
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D49979
</pre>
</div>
</content>
</entry>
<entry>
<title>bsd.compiler.mk: Add a blocks compiler feature.</title>
<updated>2025-04-22T17:44:58+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-04-22T17:44:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=12668eadcb82ec4e1bca83dc93f976bd3655ad79'/>
<id>12668eadcb82ec4e1bca83dc93f976bd3655ad79</id>
<content type='text'>
Sponsored by:	Klara, Inc.
Reviewed by:	jrtc27
Differential Revision:	https://reviews.freebsd.org/D49963
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sponsored by:	Klara, Inc.
Reviewed by:	jrtc27
Differential Revision:	https://reviews.freebsd.org/D49963
</pre>
</div>
</content>
</entry>
<entry>
<title>fts: Add blocks support.</title>
<updated>2025-04-22T17:25:56+00:00</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2025-04-22T17:16:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=f0ac5e919f3f9918075d1a6da26d12e675e45b11'/>
<id>f0ac5e919f3f9918075d1a6da26d12e675e45b11</id>
<content type='text'>
This adds an `fts_open_b()` variant of `fts_open()` which takes a block
instead of a function pointer.

This was inspired by, and is intended to be compatible with, Apple's
implementation; however, although our FTS and theirs share a common
ancestor, they have diverged significantly.  That and the fact that
we still target compilers which don't support blocks means Apple's
implementation was not directly reusable.

This is the second use case for blocks in FreeBSD (the first being
`qsort_b()`, which we use here).  This suggest we might want to add
a `COMPILER_FEATURE` for blocks to avoid hardcoding any further
`COMPILER_TYPE` checks.

MFC after:	never
Relnotes:	yes
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, theraven, imp
Differential Revision:	https://reviews.freebsd.org/D49877
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This adds an `fts_open_b()` variant of `fts_open()` which takes a block
instead of a function pointer.

This was inspired by, and is intended to be compatible with, Apple's
implementation; however, although our FTS and theirs share a common
ancestor, they have diverged significantly.  That and the fact that
we still target compilers which don't support blocks means Apple's
implementation was not directly reusable.

This is the second use case for blocks in FreeBSD (the first being
`qsort_b()`, which we use here).  This suggest we might want to add
a `COMPILER_FEATURE` for blocks to avoid hardcoding any further
`COMPILER_TYPE` checks.

MFC after:	never
Relnotes:	yes
Sponsored by:	Klara, Inc.
Reviewed by:	kevans, theraven, imp
Differential Revision:	https://reviews.freebsd.org/D49877
</pre>
</div>
</content>
</entry>
<entry>
<title>src: Use gnu++17 as the default C++ standard</title>
<updated>2025-04-11T13:53:50+00:00</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2025-04-11T13:53:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6527682ab7058e5023a2a6dea01d51c15dca701f'/>
<id>6527682ab7058e5023a2a6dea01d51c15dca701f</id>
<content type='text'>
Previously the compiler's default C++ standard was used unlike C where
bsd.sys.mk explicitly sets a default language version.  Setting an
explicit default version will give a more uniform experience across
different compilers and compiler versions.

gnu++17 was chosen to match the default C standard.  It is well
supported by a wide range of clang (5+) and GCC (9+) versions.

gnu++17 is also the default C++ standard in recent versions of clang
(16+) and GCC (11+).  As a result, many of the explicit CXXSTD
settings in Makefiles had the effect of lowering the C++ standard
instead of raising it as was originally intended and are removed.

Note that the remaining explicit CXXSTD settings for atf and liblutok
explicitly lower the standard to C++11 due to use of the deprecated
auto_ptr&lt;&gt; template which is removed in later versions.

Reviewed by:	imp, asomers, dim, emaste
Differential Revision:	https://reviews.freebsd.org/D49223
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously the compiler's default C++ standard was used unlike C where
bsd.sys.mk explicitly sets a default language version.  Setting an
explicit default version will give a more uniform experience across
different compilers and compiler versions.

gnu++17 was chosen to match the default C standard.  It is well
supported by a wide range of clang (5+) and GCC (9+) versions.

gnu++17 is also the default C++ standard in recent versions of clang
(16+) and GCC (11+).  As a result, many of the explicit CXXSTD
settings in Makefiles had the effect of lowering the C++ standard
instead of raising it as was originally intended and are removed.

Note that the remaining explicit CXXSTD settings for atf and liblutok
explicitly lower the standard to C++11 due to use of the deprecated
auto_ptr&lt;&gt; template which is removed in later versions.

Reviewed by:	imp, asomers, dim, emaste
Differential Revision:	https://reviews.freebsd.org/D49223
</pre>
</div>
</content>
</entry>
<entry>
<title>libc: tests: add some tests for __cxa_atexit handling</title>
<updated>2025-04-05T00:47:54+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2025-04-05T00:47:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ee9ce1078c596f5719f312feedd616ab0fb41dc9'/>
<id>ee9ce1078c596f5719f312feedd616ab0fb41dc9</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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>libc tests: Add some test cases for recursive exiting</title>
<updated>2024-08-07T16:06:11+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-08-07T16:06:11+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c0946aee5b2ab6c9bb2e8281a1f625914ed2fec8'/>
<id>c0946aee5b2ab6c9bb2e8281a1f625914ed2fec8</id>
<content type='text'>
Derived from tests posted by kib in D46108.  I made one of them use a
pthread barrier instead of sleeping.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D46176
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Derived from tests posted by kib in D46108.  I made one of them use a
pthread barrier instead of sleeping.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D46176
</pre>
</div>
</content>
</entry>
<entry>
<title>libc tests: Rename the quick_exit test file, fix style</title>
<updated>2024-08-07T16:05:16+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2024-07-29T14:37:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5132e16e1fd987d88798fc9dbb7a10ae3413e86f'/>
<id>5132e16e1fd987d88798fc9dbb7a10ae3413e86f</id>
<content type='text'>
Call it libc_exit_test instead of exit_test because the NetBSD test
suite already has a file with the latter name.  This is in preparation
for adding other exit()-related tests.

MFC after:	2 weeks
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Call it libc_exit_test instead of exit_test because the NetBSD test
suite already has a file with the latter name.  This is in preparation
for adding other exit()-related tests.

MFC after:	2 weeks
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove residual blank line at start of Makefile</title>
<updated>2024-07-15T22:43:39+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2024-07-15T04:46:32+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e9ac41698b2f322d55ccf9da50a3596edb2c1800'/>
<id>e9ac41698b2f322d55ccf9da50a3596edb2c1800</id>
<content type='text'>
This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
</pre>
</div>
</content>
</entry>
</feed>
