mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 22:02:58 -04:00
Add __diagused
This can be used for variables which are only used with either
INVARIANTS or WITNESS. Without any annotation they run into dead store
warnings from cc --analyze and always annotating with __unused may hide
bad vars when it should not.
Reviewed by: kib, markj
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31185
(cherry picked from commit b9296725cf)
This commit is contained in:
parent
6af8350df6
commit
bc28e9596c
1 changed files with 7 additions and 0 deletions
|
|
@ -625,6 +625,13 @@ void _gone_in_dev(device_t dev, int major, const char *msg);
|
|||
#endif
|
||||
#define gone_in(major, msg) __gone_ok(major, msg) _gone_in(major, msg)
|
||||
#define gone_in_dev(dev, major, msg) __gone_ok(major, msg) _gone_in_dev(dev, major, msg)
|
||||
|
||||
#if defined(INVARIANTS) || defined(WITNESS)
|
||||
#define __diagused
|
||||
#else
|
||||
#define __diagused __unused
|
||||
#endif
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
__NULLABILITY_PRAGMA_POP
|
||||
|
|
|
|||
Loading…
Reference in a new issue