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
F132254510: D45561.diff
Wed, Oct 15, 5:45 AM
Unknown Object (File)
Wed, Oct 8, 11:42 PM
Unknown Object (File)
Thu, Oct 2, 4:51 AM
Unknown Object (File)
Tue, Sep 23, 11:19 PM
Unknown Object (File)
Sun, Sep 21, 12:15 PM
Unknown Object (File)
Fri, Sep 19, 5:26 PM
Unknown Object (File)
Fri, Sep 19, 2:24 PM
Unknown Object (File)
Thu, Sep 18, 4:26 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