From owner-svn-src-stable-9@FreeBSD.ORG Mon Jan 2 13:01:57 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D07B61065675; Mon, 2 Jan 2012 13:01:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B41048FC19; Mon, 2 Jan 2012 13:01:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q02D1vI4067859; Mon, 2 Jan 2012 13:01:57 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q02D1vmg067855; Mon, 2 Jan 2012 13:01:57 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201021301.q02D1vmg067855@svn.freebsd.org> From: Dimitry Andric Date: Mon, 2 Jan 2012 13:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229275 - in stable/9/sys: conf modules/ath X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 13:01:58 -0000 Author: dim Date: Mon Jan 2 13:01:57 2012 New Revision: 229275 URL: http://svn.freebsd.org/changeset/base/229275 Log: MFC r228783: When building with clang, disable -Wshift-count-negative and -Wshift-count-overflow for sys/dev/ath/ath_hal/ah_regdomain.c, as it gets multiple instances of the following warnings: In file included from sys/dev/ath/ath_hal/ah_regdomain.c:99: sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:69:15: warning: shift count is negative [-Wshift-count-negative] .chan11a = BM4(F1_4950_4980, ^~~~~~~~~~~~~~~~~ sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:41:4: note: expanded from: W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) } ^ sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:34:45: note: expanded from: (((_a) > 63 && (_a) < 128 ? (((uint64_t) 1)<<((_a)-64)) : (uint64_t) 0)) ^ ~~~~~~~~~ and: In file included from sys/dev/ath/ath_hal/ah_regdomain.c:99: sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:629:15: error: shift count >= width of type [-Werror,-Wshift-count-overflow] .chan11a = BM4(W2_5260_5320, ^~~~~~~~~~~~~~~~~ sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:40:34: note: expanded from: { W0(_fa) | W0(_fb) | W0(_fc) | W0(_fd), \ ^ sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:32:44: note: expanded from: (((_a) >= 0 && (_a) < 64 ? (((uint64_t) 1)<<(_a)) : (uint64_t) 0)) ^ ~~~~ Both warnings are false positives, caused by LLVM PR 10030. For global initializations, clang fails to detect that the branch of the ternary operator causing the warning is dead. MFC r228793: Amend r228783 by also disabling -Wshift-count-negative -Wshift-count-overflow warnings for the ath module. MFC r228818: Disable various warnings for the ath module in a more fine-grained way: only add the option for the specific .c files that need them, like via sys/conf/files. Modified: stable/9/sys/conf/files stable/9/sys/conf/kern.mk stable/9/sys/modules/ath/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Jan 2 12:53:11 2012 (r229274) +++ stable/9/sys/conf/files Mon Jan 2 13:01:57 2012 (r229275) @@ -611,7 +611,7 @@ dev/ath/ath_hal/ah_eeprom_9287.c \ optional ath_hal | ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_hal/ah_regdomain.c optional ath \ - compile-with "${NORMAL_C} -I$S/dev/ath" + compile-with "${NORMAL_C} ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} -I$S/dev/ath" # ar5210 dev/ath/ath_hal/ar5210/ar5210_attach.c optional ath_hal | ath_ar5210 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" Modified: stable/9/sys/conf/kern.mk ============================================================================== --- stable/9/sys/conf/kern.mk Mon Jan 2 12:53:11 2012 (r229274) +++ stable/9/sys/conf/kern.mk Mon Jan 2 13:01:57 2012 (r229275) @@ -17,6 +17,8 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wn .if ${CC:T:Mclang} == "clang" NO_WCONSTANT_CONVERSION= -Wno-constant-conversion NO_WARRAY_BOUNDS= -Wno-array-bounds +NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative +NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow .endif # Modified: stable/9/sys/modules/ath/Makefile ============================================================================== --- stable/9/sys/modules/ath/Makefile Mon Jan 2 12:53:11 2012 (r229274) +++ stable/9/sys/modules/ath/Makefile Mon Jan 2 13:01:57 2012 (r229275) @@ -144,3 +144,6 @@ opt_ah.h: echo '#define AH_SUPPORT_AR5416 1' > $@ .include + +CWARNFLAGS.ah_regdomain.c= ${NO_WSHIFT_COUNT_NEGATIVE} ${NO_WSHIFT_COUNT_OVERFLOW} +CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}}