summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric van Gyzen <vangyzen@FreeBSD.org>2017-05-19 13:04:05 +0000
committerEric van Gyzen <vangyzen@FreeBSD.org>2017-05-19 13:04:05 +0000
commitd2335a57f43de255dc8b4d2d328fca11f89dce1f (patch)
tree54aeae832763c51840cf400ad474777629a6f9b1
parentfe3ca95c9d82b1544b2cded067796a75b21e30e2 (diff)
Notes
-rw-r--r--lib/libthr/thread/thr_attr.c2
-rw-r--r--lib/libthr/thread/thr_exit.c11
-rw-r--r--lib/libthr/thread/thr_sig.c2
-rw-r--r--lib/libthr/thread/thr_spec.c2
-rw-r--r--lib/libthr/thread/thr_stack.c17
-rw-r--r--lib/libthr/thread/thr_symbols.c4
-rw-r--r--lib/libthr/thread/thr_umtx.c2
-rw-r--r--lib/libthr/thread/thr_umtx.h4
8 files changed, 33 insertions, 11 deletions
diff --git a/lib/libthr/thread/thr_attr.c b/lib/libthr/thread/thr_attr.c
index ff9eb2d5a39d5..a79048325104e 100644
--- a/lib/libthr/thread/thr_attr.c
+++ b/lib/libthr/thread/thr_attr.c
@@ -607,7 +607,7 @@ _pthread_attr_setaffinity_np(pthread_attr_t *pattr, size_t cpusetsize,
/* Kernel checks invalid bits, we check it here too. */
size_t i;
for (i = kern_size; i < cpusetsize; ++i) {
- if (((char *)cpusetp)[i])
+ if (((const char *)cpusetp)[i])
return (EINVAL);
}
}
diff --git a/lib/libthr/thread/thr_exit.c b/lib/libthr/thread/thr_exit.c
index 53904c6feaf2b..decc2f2983b7b 100644
--- a/lib/libthr/thread/thr_exit.c
+++ b/lib/libthr/thread/thr_exit.c
@@ -119,7 +119,8 @@ _Unwind_GetCFA(struct _Unwind_Context *context)
#endif /* PIC */
static void
-thread_unwind_cleanup(_Unwind_Reason_Code code, struct _Unwind_Exception *e)
+thread_unwind_cleanup(_Unwind_Reason_Code code __unused,
+ struct _Unwind_Exception *e __unused)
{
/*
* Specification said that _Unwind_Resume should not be used here,
@@ -130,10 +131,10 @@ thread_unwind_cleanup(_Unwind_Reason_Code code, struct _Unwind_Exception *e)
}
static _Unwind_Reason_Code
-thread_unwind_stop(int version, _Unwind_Action actions,
- int64_t exc_class,
- struct _Unwind_Exception *exc_obj,
- struct _Unwind_Context *context, void *stop_parameter)
+thread_unwind_stop(int version __unused, _Unwind_Action actions,
+ int64_t exc_class __unused,
+ struct _Unwind_Exception *exc_obj __unused,
+ struct _Unwind_Context *context, void *stop_parameter __unused)
{
struct pthread *curthread = _get_curthread();
struct pthread_cleanup *cur;
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c
index 824153952d894..3329a82159b6d 100644
--- a/lib/libthr/thread/thr_sig.c
+++ b/lib/libthr/thread/thr_sig.c
@@ -441,7 +441,7 @@ _thr_signal_init(int dlopened)
}
void
-_thr_sigact_unload(struct dl_phdr_info *phdr_info)
+_thr_sigact_unload(struct dl_phdr_info *phdr_info __unused)
{
#if 0
struct pthread *curthread = _get_curthread();
diff --git a/lib/libthr/thread/thr_spec.c b/lib/libthr/thread/thr_spec.c
index 46d4ddf30bc6f..303e34e4afe0f 100644
--- a/lib/libthr/thread/thr_spec.c
+++ b/lib/libthr/thread/thr_spec.c
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
#include "thr_private.h"
-struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX];
+static struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX];
__weak_reference(_pthread_key_create, pthread_key_create);
__weak_reference(_pthread_key_delete, pthread_key_delete);
diff --git a/lib/libthr/thread/thr_stack.c b/lib/libthr/thread/thr_stack.c
index 3510a74ab43f1..19bb2903f3c31 100644
--- a/lib/libthr/thread/thr_stack.c
+++ b/lib/libthr/thread/thr_stack.c
@@ -290,6 +290,19 @@ _thr_stack_alloc(struct pthread_attr *attr)
return (-1);
}
+/*
+ * Disable this warning from clang:
+ *
+ * cast from 'char *' to
+ * 'struct stack *' increases required alignment from 1 to 8
+ * [-Werror,-Wcast-align]
+ * spare_stack = (struct stack *)
+ */
+#ifdef __clang__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-align"
+#endif
+
/* This function must be called with _thread_list_lock held. */
void
_thr_stack_free(struct pthread_attr *attr)
@@ -316,3 +329,7 @@ _thr_stack_free(struct pthread_attr *attr)
attr->stackaddr_attr = NULL;
}
}
+
+#ifdef __clang__
+#pragma GCC diagnostic pop
+#endif
diff --git a/lib/libthr/thread/thr_symbols.c b/lib/libthr/thread/thr_symbols.c
index 9eef8db1a0a67..0c9ccb8788ec3 100644
--- a/lib/libthr/thread/thr_symbols.c
+++ b/lib/libthr/thread/thr_symbols.c
@@ -37,6 +37,10 @@ __FBSDID("$FreeBSD$");
#include "thr_private.h"
+#ifdef __clang__
+#pragma GCC diagnostic ignored "-Wmissing-variable-declarations"
+#endif
+
/* A collection of symbols needed by debugger */
/* int _libthr_debug */
diff --git a/lib/libthr/thread/thr_umtx.c b/lib/libthr/thread/thr_umtx.c
index cd2b101e0770b..085e04e22dfbe 100644
--- a/lib/libthr/thread/thr_umtx.c
+++ b/lib/libthr/thread/thr_umtx.c
@@ -168,7 +168,7 @@ __thr_umutex_timedlock(struct umutex *mtx, uint32_t id,
}
int
-__thr_umutex_unlock(struct umutex *mtx, uint32_t id)
+__thr_umutex_unlock(struct umutex *mtx)
{
return (_umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0));
diff --git a/lib/libthr/thread/thr_umtx.h b/lib/libthr/thread/thr_umtx.h
index fff8729d589b9..5dae304528da7 100644
--- a/lib/libthr/thread/thr_umtx.h
+++ b/lib/libthr/thread/thr_umtx.h
@@ -44,7 +44,7 @@ int __thr_umutex_lock(struct umutex *mtx, uint32_t id) __hidden;
int __thr_umutex_lock_spin(struct umutex *mtx, uint32_t id) __hidden;
int __thr_umutex_timedlock(struct umutex *mtx, uint32_t id,
const struct timespec *timeout) __hidden;
-int __thr_umutex_unlock(struct umutex *mtx, uint32_t id) __hidden;
+int __thr_umutex_unlock(struct umutex *mtx) __hidden;
int __thr_umutex_trylock(struct umutex *mtx) __hidden;
int __thr_umutex_set_ceiling(struct umutex *mtx, uint32_t ceiling,
uint32_t *oldceiling) __hidden;
@@ -155,7 +155,7 @@ _thr_umutex_unlock2(struct umutex *mtx, uint32_t id, int *defer)
if (atomic_cmpset_rel_32(&mtx->m_owner, id, noncst ?
UMUTEX_RB_NOTRECOV : UMUTEX_UNOWNED))
return (0);
- return (__thr_umutex_unlock(mtx, id));
+ return (__thr_umutex_unlock(mtx));
}
do {