HomeFreeBSD

cdefs: Introduce __result_use_or_ignore_check

Description

cdefs: Introduce __result_use_or_ignore_check

Try to paper over inconsistent semantics for warn_unused_result
between clang and gcc. See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 for a spirited
discussion of these semantics.

Introduce result_use_or_ignore_check, which allows callers to
explicitly ignore the return value with a cast to void. Use that to
restore some checking for copyout() and friends, previously removed in
commit d07acc58d898 ("systm: Relax
result_use_check annotations").

Reviewed by: olce, rpokala, kib, emaste
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D43426

Details

Provenance
markjAuthored on Feb 3 2024, 7:16 PM
Reviewer
olce
Differential Revision
D43426: cdefs: Introduce __result_use_or_ignore_check
Parents
rGf73124b077d8: ctfmerge: Remove function cast of strcompare() for qsort()
Branches
Unknown
Tags
Unknown