Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jan 2012 12:53:12 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r229274 - in stable/9/sys: conf modules/asr
Message-ID:  <201201021253.q02CrC41067496@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Mon Jan  2 12:53:11 2012
New Revision: 229274
URL: http://svn.freebsd.org/changeset/base/229274

Log:
  MFC r228781:
  
    When building with clang, disable -Warray-bounds for sys/dev/asr/asr.c,
    as it gets the following warning:
  
    sys/dev/asr/asr.c:1836:29: warning: array index of '58' indexes past the end of an array (that contains 1 element) [-Warray-bounds]
            while ((len > 0) && (sg < &((PPRIVATE_SCSI_SCB_EXECUTE_MESSAGE)
                                       ^
    sys/dev/asr/i2omsg.h:934:8: note: array 'Simple' declared here
           I2O_SGE_SIMPLE_ELEMENT              Simple[1];
           ^
  
    This is a false positive, since I2O_SG_ELEMENT::Simple is not declared
    as a C99 flexible array member, but in the old (but more portable) way.
    At run-time, the proper number of array elements will hopefully have
    been allocated.
  
  MFC r228865:
  
    Amend r228781 by also disabling -Warray-bounds warnings for the asr
    module.

Modified:
  stable/9/sys/conf/files
  stable/9/sys/conf/kern.mk
  stable/9/sys/modules/asr/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:50:19 2012	(r229273)
+++ stable/9/sys/conf/files	Mon Jan  2 12:53:11 2012	(r229274)
@@ -529,7 +529,8 @@ dev/an/if_an.c			optional an
 dev/an/if_an_isa.c		optional an isa
 dev/an/if_an_pccard.c		optional an pccard
 dev/an/if_an_pci.c		optional an pci
-dev/asr/asr.c			optional asr pci
+dev/asr/asr.c			optional asr pci \
+	compile-with "${NORMAL_C} ${NO_WARRAY_BOUNDS}"
 #
 dev/ata/ata_if.m		optional ata | atacore
 dev/ata/ata-all.c		optional ata | atacore

Modified: stable/9/sys/conf/kern.mk
==============================================================================
--- stable/9/sys/conf/kern.mk	Mon Jan  2 12:50:19 2012	(r229273)
+++ stable/9/sys/conf/kern.mk	Mon Jan  2 12:53:11 2012	(r229274)
@@ -16,6 +16,7 @@ CWARNFLAGS?=	-Wall -Wredundant-decls -Wn
 # a false positive.
 .if ${CC:T:Mclang} == "clang"
 NO_WCONSTANT_CONVERSION=	-Wno-constant-conversion
+NO_WARRAY_BOUNDS=		-Wno-array-bounds
 .endif
 
 #

Modified: stable/9/sys/modules/asr/Makefile
==============================================================================
--- stable/9/sys/modules/asr/Makefile	Mon Jan  2 12:50:19 2012	(r229273)
+++ stable/9/sys/modules/asr/Makefile	Mon Jan  2 12:53:11 2012	(r229274)
@@ -12,3 +12,6 @@ SRCS+=	opt_asr.h
 .endif
 
 .include <bsd.kmod.mk>
+
+CWARNFLAGS.asr.c=	${NO_WARRAY_BOUNDS}
+CWARNFLAGS+=		${CWARNFLAGS.${.IMPSRC:T}}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201021253.q02CrC41067496>