From owner-svn-src-all@FreeBSD.ORG Mon Jan 2 12:50:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53C1A1065672; Mon, 2 Jan 2012 12:50:20 +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 371248FC0C; Mon, 2 Jan 2012 12:50:20 +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 q02CoK7F067350; Mon, 2 Jan 2012 12:50:20 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q02CoJrt067344; Mon, 2 Jan 2012 12:50:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201021250.q02CoJrt067344@svn.freebsd.org> From: Dimitry Andric Date: Mon, 2 Jan 2012 12:50:19 +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: r229273 - in stable/9/sys: conf modules/aic7xxx/ahc/ahc_pci modules/aic7xxx/ahd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2012 12:50:20 -0000 Author: dim Date: Mon Jan 2 12:50:19 2012 New Revision: 229273 URL: http://svn.freebsd.org/changeset/base/229273 Log: MFC r228779: Start selectively disabling a few kernel build warnings for clang, since there are some places in the kernel where fixing them is too disruptive, or where there is a false positive. In this case, disable -Wconstant-conversion for two aic7xxx-related files, as they get the following warning on i386 (and possibly on other 32-bit arches): sys/dev/aic7xxx/ahc_pci.c:112:10: warning: implicit conversion from 'long long' to 'bus_addr_t' (aka 'unsigned int') changes value from 549755813887 to 4294967295 [-Wconstant-conversion] ? 0x7FFFFFFFFFLL ~~^~~~~~~~~~~~~~ This is a false positive, since the code only passes the 0x7FFFFFFFFFLL argument, if sizeof(bus_addr_t) is larger than 4 (e.g. on 64 bit arches, or when PAE is enabled on i386). The code could be refactored to do compile-time checks, but that is more disruptive. MFC r228789: Amend r228779 by also disabling -Wconstant-conversion warnings for the aic7xxx module. MFC r228805: Disable -Wconstant-conversion warnings for the aic7xxx 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/aic7xxx/ahc/ahc_pci/Makefile stable/9/sys/modules/aic7xxx/ahd/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:12:10 2012 (r229272) +++ stable/9/sys/conf/files Mon Jan 2 12:50:19 2012 (r229273) @@ -505,8 +505,10 @@ dev/aic/aic.c optional aic dev/aic/aic_pccard.c optional aic pccard dev/aic7xxx/ahc_eisa.c optional ahc eisa dev/aic7xxx/ahc_isa.c optional ahc isa -dev/aic7xxx/ahc_pci.c optional ahc pci -dev/aic7xxx/ahd_pci.c optional ahd pci +dev/aic7xxx/ahc_pci.c optional ahc pci \ + compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" +dev/aic7xxx/ahd_pci.c optional ahd pci \ + compile-with "${NORMAL_C} ${NO_WCONSTANT_CONVERSION}" dev/aic7xxx/aic7770.c optional ahc dev/aic7xxx/aic79xx.c optional ahd pci dev/aic7xxx/aic79xx_osm.c optional ahd pci Modified: stable/9/sys/conf/kern.mk ============================================================================== --- stable/9/sys/conf/kern.mk Mon Jan 2 12:12:10 2012 (r229272) +++ stable/9/sys/conf/kern.mk Mon Jan 2 12:50:19 2012 (r229273) @@ -11,6 +11,13 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wn # The following flags are next up for working on: # -Wextra +# Disable a few warnings for clang, since there are several places in the +# kernel where fixing them is more trouble than it is worth, or where there is +# a false positive. +.if ${CC:T:Mclang} == "clang" +NO_WCONSTANT_CONVERSION= -Wno-constant-conversion +.endif + # # On i386, do not align the stack to 16-byte boundaries. Otherwise GCC 2.95 # and above adds code to the entry and exit point of every function to align the Modified: stable/9/sys/modules/aic7xxx/ahc/ahc_pci/Makefile ============================================================================== --- stable/9/sys/modules/aic7xxx/ahc/ahc_pci/Makefile Mon Jan 2 12:12:10 2012 (r229272) +++ stable/9/sys/modules/aic7xxx/ahc/ahc_pci/Makefile Mon Jan 2 12:50:19 2012 (r229273) @@ -14,3 +14,6 @@ SRCS+= opt_scsi.h opt_cam.h opt_aic7xxx. CFLAGS+= -I${.CURDIR}/../../../../dev/aic7xxx -I.. .include + +CWARNFLAGS.ahc_pci.c= ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/modules/aic7xxx/ahd/Makefile ============================================================================== --- stable/9/sys/modules/aic7xxx/ahd/Makefile Mon Jan 2 12:12:10 2012 (r229272) +++ stable/9/sys/modules/aic7xxx/ahd/Makefile Mon Jan 2 12:50:19 2012 (r229273) @@ -36,3 +36,6 @@ SRCS+= device_if.h bus_if.h pci_if.h CLEANFILES= ${GENSRCS} .include + +CWARNFLAGS.ahd_pci.c= ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}}