Page MenuHomeFreeBSD

include: add a userland version of __assert_unreachable
ClosedPublic

Authored by kevans on Dec 14 2024, 5:26 AM.
Tags
None
Referenced Files
F139980089: D48077.id149163.diff
Thu, Dec 18, 3:16 PM
F139957015: D48077.diff
Thu, Dec 18, 9:40 AM
Unknown Object (File)
Fri, Dec 5, 5:02 PM
Unknown Object (File)
Thu, Nov 27, 1:08 AM
Unknown Object (File)
Nov 12 2025, 10:08 PM
Unknown Object (File)
Nov 6 2025, 10:48 PM
Unknown Object (File)
Nov 6 2025, 7:21 PM
Unknown Object (File)
Nov 6 2025, 6:47 AM

Details

Summary

The kernel has had a version of this since
c79cee71363d ("kernel: provide panicky version of unreachable"), and
userland can benefit from the same.
unreachable is largely
inadequate because it's *not* an assertion of any sort, so we're not
really alerted to a problem that we could've anticipated.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61155
Build 58039: arc lint + arc unit

Event Timeline

kevans created this revision.
This revision is now accepted and ready to land.Dec 14 2024, 5:32 AM

C23 added unreachable () to <stddef.h>. Wouldn't that be preferable to the leading __ for userland?

C23 added unreachable () to <stddef.h>. Wouldn't that be preferable to the leading __ for userland?

My can't assume C23 in system headers, so we'd end up shimming it out with an __unreachable in <sys/cdefs.h> anyways to make it usable