Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern kern: Mark some functions __diagused to pacify clang.
details: https://anonhg.NetBSD.org/src/rev/45610339aa01
branches: trunk
changeset: 360007:45610339aa01
user: riastradh <riastradh%NetBSD.org@localhost>
date: Tue Feb 08 12:59:16 2022 +0000
description:
kern: Mark some functions __diagused to pacify clang.
These functions are called only in KASSERT. This shouldn't be a
problem since the recent change to make KASSERT compile (but not run)
the expression, via sizeof, so the functions are referenced -- which
I did in order to avoid having #ifdefs and regular build breakage
because someone forgot to build with or without DIAGNOSTIC. But
apparently clang decided to make it a problem.
Maybe we should just set -Wno-unneeded-internal-declaration -- not
clear it flags any real problems, but it takes effort to research
because apparently clang has no documentation about what else it does
or why anyone decided this is objectionable enough to turn it on by
default. (The only documentation it seems to have, two example
warning messages with no elaboration at
<https://releases.llvm.org/13.0.0/tools/clang/docs/DiagnosticsReference.html#wunneeded-internal-declaration>,
seems to indicate it is mixed up with warning about static non-inline
functions in header files.)
diffstat:
sys/kern/subr_pcu.c | 6 +++---
sys/kern/subr_psref.c | 6 +++---
sys/kern/subr_thmap.c | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diffs (81 lines):
diff -r 22848e08cbcd -r 45610339aa01 sys/kern/subr_pcu.c
--- a/sys/kern/subr_pcu.c Tue Feb 08 08:57:11 2022 +0000
+++ b/sys/kern/subr_pcu.c Tue Feb 08 12:59:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_pcu.c,v 1.25 2022/01/01 15:10:53 christos Exp $ */
+/* $NetBSD: subr_pcu.c,v 1.26 2022/02/08 12:59:16 riastradh Exp $ */
/*-
* Copyright (c) 2011, 2014 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pcu.c,v 1.25 2022/01/01 15:10:53 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pcu.c,v 1.26 2022/02/08 12:59:16 riastradh Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -91,7 +91,7 @@
/*
* pcu_available_p: true if lwp is allowed to use PCU state.
*/
-static inline bool
+static inline bool __diagused
pcu_available_p(struct lwp *l)
{
diff -r 22848e08cbcd -r 45610339aa01 sys/kern/subr_psref.c
--- a/sys/kern/subr_psref.c Tue Feb 08 08:57:11 2022 +0000
+++ b/sys/kern/subr_psref.c Tue Feb 08 12:59:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_psref.c,v 1.16 2021/12/31 14:19:57 riastradh Exp $ */
+/* $NetBSD: subr_psref.c,v 1.17 2022/02/08 12:59:16 riastradh Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_psref.c,v 1.16 2021/12/31 14:19:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_psref.c,v 1.17 2022/02/08 12:59:16 riastradh Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -170,7 +170,7 @@
return class;
}
-static void
+static void __diagused
psref_cpu_drained_p(void *p, void *cookie, struct cpu_info *ci __unused)
{
const struct psref_cpu *pcpu = p;
diff -r 22848e08cbcd -r 45610339aa01 sys/kern/subr_thmap.c
--- a/sys/kern/subr_thmap.c Tue Feb 08 08:57:11 2022 +0000
+++ b/sys/kern/subr_thmap.c Tue Feb 08 12:59:16 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_thmap.c,v 1.8 2021/12/31 14:19:57 riastradh Exp $ */
+/* $NetBSD: subr_thmap.c,v 1.9 2022/02/08 12:59:16 riastradh Exp $ */
/*-
* Copyright (c) 2018 Mindaugas Rasiukevicius <rmind at noxt eu>
@@ -112,7 +112,7 @@
#include "utils.h"
#endif
-THMAP_RCSID("$NetBSD: subr_thmap.c,v 1.8 2021/12/31 14:19:57 riastradh Exp $");
+THMAP_RCSID("$NetBSD: subr_thmap.c,v 1.9 2022/02/08 12:59:16 riastradh Exp $");
#include <crypto/blake2/blake2s.h>
@@ -256,7 +256,7 @@
* NODE LOCKING.
*/
-static inline bool
+static inline bool __diagused
node_locked_p(thmap_inode_t *node)
{
return (atomic_load_relaxed(&node->state) & NODE_LOCKED) != 0;
Home |
Main Index |
Thread Index |
Old Index