git: cce4979133ba - main - ktrace: Add __ktrace_used

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Sat, 09 Mar 2024 05:40:08 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=cce4979133ba540ca2dfd57631c6f91673b9bafd

commit cce4979133ba540ca2dfd57631c6f91673b9bafd
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-03-09 05:08:43 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-03-09 05:33:55 +0000

    ktrace: Add __ktrace_used
    
    This suppresses warnings about write-only variables when the KTRACE
    option is disabled, akin __diagused and __witness_used.
    
    MFC after:      1 week
---
 sys/sys/ktrace.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/sys/ktrace.h b/sys/sys/ktrace.h
index 251efa1e48db..710c78c2604d 100644
--- a/sys/sys/ktrace.h
+++ b/sys/sys/ktrace.h
@@ -334,8 +334,10 @@ void	ktrcapfail(enum ktr_cap_fail_type, const cap_rights_t *,
 extern u_int ktr_geniosize;
 #ifdef	KTRACE
 extern int ktr_filesize_limit_signal;
+#define	__ktrace_used
 #else
 #define	ktr_filesize_limit_signal 0
+#define	__ktrace_used	__unused
 #endif
 #else