HomeFreeBSD

cdefs(9): encourage __nodiscard over __result_use_check

Description

cdefs(9): encourage nodiscard over result_use_check

nodiscard is closer to (and sometimes expands to) nodiscard from
C23 and C++17 so prefer it to the homegrown
result_use_check.

When nodiscard does expand to nodiscard it must appear entierly
before the function declaration (or between the function name
and argument list) so relocate as appropriate. This differs from
attribute((warn_unused_result)) used by result_use_check which
is more flexible.

Reviewed by: imp, markj, emaste
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D57881

Details

Provenance
brooksAuthored on Jun 26 2026, 4:41 PM
Reviewer
imp
Differential Revision
D57881: cdefs(9): encourage __nodiscard over __result_use_check
Parents
rGad26a56cf2f5: acpi_timer(4): Remove unused 'acpi_timer_disabled' boolean
Branches
Unknown
Tags
Unknown