git: 588ce1a3ac8d - main - kobj: avoid gcc -Wcast-function-type
Ryan Libby
rlibby at FreeBSD.org
Sun Mar 14 23:20:30 UTC 2021
The branch main has been updated by rlibby:
URL: https://cgit.FreeBSD.org/src/commit/?id=588ce1a3ac8d61c99c7827dc71191c46c2d927b7
commit 588ce1a3ac8d61c99c7827dc71191c46c2d927b7
Author: Ryan Libby <rlibby at FreeBSD.org>
AuthorDate: 2021-03-14 23:04:27 +0000
Commit: Ryan Libby <rlibby at FreeBSD.org>
CommitDate: 2021-03-14 23:04:27 +0000
kobj: avoid gcc -Wcast-function-type
The actual type of kobjop_t is arbitrary, it is only used as a generic
function pointer type. Declare it as void (*)(void) in order to avoid
gcc's -Wcast-function-type, which is included in -Wextra.
Reviewed by: avg, jhb
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D28769
---
sys/sys/kobj.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/sys/kobj.h b/sys/sys/kobj.h
index da8c2d5106bb..aaf92688ca08 100644
--- a/sys/sys/kobj.h
+++ b/sys/sys/kobj.h
@@ -37,7 +37,7 @@
typedef struct kobj *kobj_t;
typedef struct kobj_class *kobj_class_t;
typedef const struct kobj_method kobj_method_t;
-typedef int (*kobjop_t)(void);
+typedef void (*kobjop_t)(void);
typedef struct kobj_ops *kobj_ops_t;
typedef struct kobjop_desc *kobjop_desc_t;
struct malloc_type;
More information about the dev-commits-src-all
mailing list