git: 07d359787f0d - main - libthr: avoid gcc -Wcast-function-type
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 03 Jul 2024 16:15:00 UTC
The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=07d359787f0d7f8e5682a3d1991ef68711fb94d1 commit 07d359787f0d7f8e5682a3d1991ef68711fb94d1 Author: Ryan Libby <rlibby@FreeBSD.org> AuthorDate: 2024-07-03 15:38:32 +0000 Commit: Ryan Libby <rlibby@FreeBSD.org> CommitDate: 2024-07-03 15:38:32 +0000 libthr: avoid gcc -Wcast-function-type The actual types of pthread_func_t and interpos_func_t are not used. Declare them as the generic void (*)(void) which suppresses warnings. https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wcast-function-type Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45830 --- lib/libc/include/libc_private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 2b16ce736e3a..4d4779647f50 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -190,7 +190,7 @@ typedef enum { PJT_MAX } pjt_index_t; -typedef int (*pthread_func_t)(void); +typedef void (*pthread_func_t)(void); typedef pthread_func_t pthread_func_entry_t[2]; extern pthread_func_entry_t __thr_jtable[]; @@ -199,7 +199,7 @@ void __set_error_selector(int *(*arg)(void)); int _pthread_mutex_init_calloc_cb_stub(pthread_mutex_t *mutex, void *(calloc_cb)(__size_t, __size_t)); -typedef int (*interpos_func_t)(void); +typedef void (*interpos_func_t)(void); interpos_func_t *__libc_interposing_slot(int interposno); extern interpos_func_t __libc_interposing[] __hidden; interpos_func_t *__libsys_interposing_slot(int interposno);