svn commit: r228779 - head/sys/conf

Dimitry Andric dim at FreeBSD.org
Wed Dec 21 15:59:19 UTC 2011


Author: dim
Date: Wed Dec 21 15:59:18 2011
New Revision: 228779
URL: http://svn.freebsd.org/changeset/base/228779

Log:
  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 after:	1 week

Modified:
  head/sys/conf/files
  head/sys/conf/kern.mk

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Dec 21 15:40:26 2011	(r228778)
+++ head/sys/conf/files	Wed Dec 21 15:59:18 2011	(r228779)
@@ -508,8 +508,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: head/sys/conf/kern.mk
==============================================================================
--- head/sys/conf/kern.mk	Wed Dec 21 15:40:26 2011	(r228778)
+++ head/sys/conf/kern.mk	Wed Dec 21 15:59:18 2011	(r228779)
@@ -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


More information about the svn-src-head mailing list