From 13b7412dad9b976e41fc080b8cdac4f670746fa7 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Mon, 1 Sep 2014 20:18:09 +0000 Subject: [PATCH] Add -Wthread-safety to WARNS=6. While there, add a NO_WTHREAD_SAFETY flag that can be used to disable this specific warning flag. Disable it for auditdistd. We can easily patch up auditdistd to have the right annotations to build, but as auditdistd is intended to be portable across other operating systems, it's not worth the effort. Approved by: brueffer@ --- share/mk/bsd.sys.mk | 3 +++ usr.sbin/auditdistd/Makefile | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 58d617149402..635d428d5cda 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -54,6 +54,9 @@ CWARNFLAGS+= -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls\ .if !defined(NO_WMISSING_VARIABLE_DECLARATIONS) CWARNFLAGS.clang+= -Wmissing-variable-declarations .endif +.if !defined(NO_WTHREAD_SAFETY) +CWARNFLAGS.clang+= -Wthread-safety +.endif .endif # WARNS >= 6 .if ${WARNS} >= 2 && ${WARNS} <= 4 # XXX Delete -Wuninitialized by default for now -- the compiler doesn't diff --git a/usr.sbin/auditdistd/Makefile b/usr.sbin/auditdistd/Makefile index ee18bca33218..b323dcd3e9cb 100644 --- a/usr.sbin/auditdistd/Makefile +++ b/usr.sbin/auditdistd/Makefile @@ -30,4 +30,8 @@ YFLAGS+=-v CLEANFILES=parse.c parse.h parse.output +# auditdistd cannot use FreeBSD specific lock annotation macros. Disable +# thread safety analysis completely. +NO_WTHREAD_SAFETY= + .include