aboutsummaryrefslogtreecommitdiff
path: root/lib/libthr
diff options
context:
space:
mode:
authorEric van Gyzen <vangyzen@FreeBSD.org>2017-05-20 17:33:47 +0000
committerEric van Gyzen <vangyzen@FreeBSD.org>2017-05-20 17:33:47 +0000
commit0b2f3f20583595d0007fdfc8218fb4da4b999c49 (patch)
tree7bb11511dba0fe27613027bb4be122c7c0ac3673 /lib/libthr
parentd71b2897669b0dac45453e049a3c294cd8d297b3 (diff)
Notes
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/Makefile6
-rw-r--r--lib/libthr/thread/thr_stack.c17
-rw-r--r--lib/libthr/thread/thr_symbols.c4
3 files changed, 6 insertions, 21 deletions
diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile
index 3e7a0244ef94..3e80503e2267 100644
--- a/lib/libthr/Makefile
+++ b/lib/libthr/Makefile
@@ -27,6 +27,12 @@ CFLAGS+=-I${SRCTOP}/libexec/rtld-elf/${MACHINE_CPUARCH}
CFLAGS+=-I${SRCTOP}/lib/libthread_db
CFLAGS+=-Winline
+CFLAGS.thr_stack.c+= -Wno-cast-align
+.include <bsd.compiler.mk>
+.if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300)
+CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations
+.endif
+
.ifndef NO_THREAD_UNWIND_STACK
CFLAGS+=-fexceptions
CFLAGS+=-D_PTHREAD_FORCED_UNWIND
diff --git a/lib/libthr/thread/thr_stack.c b/lib/libthr/thread/thr_stack.c
index 19bb2903f3c3..3510a74ab43f 100644
--- a/lib/libthr/thread/thr_stack.c
+++ b/lib/libthr/thread/thr_stack.c
@@ -290,19 +290,6 @@ _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)
@@ -329,7 +316,3 @@ _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 0c9ccb8788ec..9eef8db1a0a6 100644
--- a/lib/libthr/thread/thr_symbols.c
+++ b/lib/libthr/thread/thr_symbols.c
@@ -37,10 +37,6 @@ __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 */