Page MenuHomeFreeBSD

cdefs: Add __writeonly to mark write only vars
ClosedPublic

Authored by andrew on Jun 11 2024, 11:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Aug 31, 2:42 AM
Unknown Object (File)
Wed, Aug 26, 5:11 AM
Unknown Object (File)
Fri, Aug 14, 9:56 AM
Unknown Object (File)
Mon, Aug 10, 11:06 AM
Unknown Object (File)
Mon, Aug 10, 11:04 AM
Unknown Object (File)
Aug 7 2026, 9:22 PM
Unknown Object (File)
Aug 7 2026, 4:41 PM
Unknown Object (File)
Aug 6 2026, 11:19 AM
Subscribers
None

Details

Summary

When a variable in write only and can't be removed, e.g. for API
reasons, it is useful to document this fact similar to diagused
and
witness_used.

Add __writeonly to tell the compiler and anyone looking at the code
that this variable is expected to only be written to, and to not
raise and error.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable