diff options
author | dim <dim@FreeBSD.org> | 2011-12-21 17:01:13 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-12-21 17:01:13 +0000 |
commit | 8267c9aa1bd5b448396ef0742a10f8e2e6b26a99 (patch) | |
tree | b4d1898be87ea5a84571175733769c044baa451c | |
parent | 2cc69e2d2a00b0ef6b1753b9d4c9a7b85866195c (diff) | |
download | FreeBSD-src-8267c9aa1bd5b448396ef0742a10f8e2e6b26a99.zip FreeBSD-src-8267c9aa1bd5b448396ef0742a10f8e2e6b26a99.tar.gz |
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 after: 1 week
-rw-r--r-- | sys/conf/files | 2 | ||||
-rw-r--r-- | sys/conf/kern.mk | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sys/conf/files b/sys/conf/files index 7d8ce4b..55fd4b2 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -613,7 +613,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" diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 745b0e1..c53d88e 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -17,6 +17,8 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ .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 # |