From owner-svn-src-head@freebsd.org Sat May 20 17:33:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C709D7609A; Sat, 20 May 2017 17:33:49 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3FDC17B2; Sat, 20 May 2017 17:33:48 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4KHXlJb031335; Sat, 20 May 2017 17:33:47 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4KHXlT6031332; Sat, 20 May 2017 17:33:47 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201705201733.v4KHXlT6031332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 20 May 2017 17:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318584 - in head/lib/libthr: . thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 May 2017 17:33:49 -0000 Author: vangyzen Date: Sat May 20 17:33:47 2017 New Revision: 318584 URL: https://svnweb.freebsd.org/changeset/base/318584 Log: libthr: Use CLI flags instead of pragmas to disable warnings People tweaking the build system or compilers tend to look into the Makefile and not into the source. Having some warning controls in the Makefile and some in the source code is surprising. Pragmas have the advantage that they leave the warnings enabled for more code, but that advantage isn't very relevant in these cases. Requested by: kib Reviewed by: kib MFC after: 3 days Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10832 Modified: head/lib/libthr/Makefile head/lib/libthr/thread/thr_stack.c head/lib/libthr/thread/thr_symbols.c Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Sat May 20 17:32:30 2017 (r318583) +++ head/lib/libthr/Makefile Sat May 20 17:33:47 2017 (r318584) @@ -27,6 +27,12 @@ CFLAGS+=-I${SRCTOP}/libexec/rtld-elf/${M CFLAGS+=-I${SRCTOP}/lib/libthread_db CFLAGS+=-Winline +CFLAGS.thr_stack.c+= -Wno-cast-align +.include +.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 Modified: head/lib/libthr/thread/thr_stack.c ============================================================================== --- head/lib/libthr/thread/thr_stack.c Sat May 20 17:32:30 2017 (r318583) +++ head/lib/libthr/thread/thr_stack.c Sat May 20 17:33:47 2017 (r318584) @@ -290,19 +290,6 @@ _thr_stack_alloc(struct pthread_attr *at 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 *att attr->stackaddr_attr = NULL; } } - -#ifdef __clang__ -#pragma GCC diagnostic pop -#endif Modified: head/lib/libthr/thread/thr_symbols.c ============================================================================== --- head/lib/libthr/thread/thr_symbols.c Sat May 20 17:32:30 2017 (r318583) +++ head/lib/libthr/thread/thr_symbols.c Sat May 20 17:33:47 2017 (r318584) @@ -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 */