From c234c2de73b189a1e447f8d481bce7f54633d9b0 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 30 Jan 2015 18:17:17 +0000 Subject: [PATCH] For clang, disable -Wcast-qual warnings for specific aesni files, since clang 3.6.0 will emit a number of such warnings for those files, and they are partially contributed code. --- sys/conf/files.amd64 | 4 ++-- sys/conf/kern.mk | 1 + sys/modules/aesni/Makefile | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index bbbe82701938..996a0cf3f5c5 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -131,12 +131,12 @@ crypto/aesni/aeskeys_amd64.S optional aesni crypto/aesni/aesni.c optional aesni aesni_ghash.o optional aesni \ dependency "$S/crypto/aesni/aesni_ghash.c" \ - compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ + compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}" \ no-implicit-rule \ clean "aesni_ghash.o" aesni_wrap.o optional aesni \ dependency "$S/crypto/aesni/aesni_wrap.c" \ - compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} -mmmx -msse -msse4 -maes ${.IMPSRC}" \ + compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes ${.IMPSRC}" \ no-implicit-rule \ clean "aesni_wrap.o" crypto/blowfish/bf_enc.c optional crypto | ipsec diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index b964151437e7..c031b3a37906 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -23,6 +23,7 @@ NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow NO_WSELF_ASSIGN= -Wno-self-assign NO_WUNNEEDED_INTERNAL_DECL= -Wno-unneeded-internal-declaration NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized +NO_WCAST_QUAL= -Wno-cast-qual # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. diff --git a/sys/modules/aesni/Makefile b/sys/modules/aesni/Makefile index 6fdfc7e32694..bfba745e86af 100644 --- a/sys/modules/aesni/Makefile +++ b/sys/modules/aesni/Makefile @@ -22,3 +22,6 @@ aesni_wrap.o: aesni_wrap.c ${CTFCONVERT_CMD} .include + +CWARNFLAGS.aesni_ghash.c= ${NO_WCAST_QUAL} +CWARNFLAGS.aesni_wrap.c= ${NO_WCAST_QUAL}