From owner-freebsd-current@FreeBSD.ORG Sat Dec 1 11:05:51 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82ED2EE3 for ; Sat, 1 Dec 2012 11:05:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C7D0C8FC08 for ; Sat, 1 Dec 2012 11:05:48 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA28567; Sat, 01 Dec 2012 13:05:36 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Tekt6-00056g-7c; Sat, 01 Dec 2012 13:05:36 +0200 Message-ID: <50B9E47F.6070005@FreeBSD.org> Date: Sat, 01 Dec 2012 13:05:35 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Garrett Cooper Subject: Re: A suspicious warning in sys/boot/zfs/zfsimpl.c References: <20120703102142.6554b10e.taku@tackymt.homeip.net> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Taku YAMAMOTO , freebsd-current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 11:05:51 -0000 on 01/12/2012 12:59 Garrett Cooper said the following: > On Mon, Jul 2, 2012 at 6:21 PM, Taku YAMAMOTO wrote: >> When I built the world as of r237813, clang reported a warning which >> caught my attention. >> >> ===> sys/boot/zfs (all) >> clang -O2 -pipe -march=pentium4 -DBOOTPROG=\"zfsloader\" -I/usr/src/sys/boot/zfs/../common -I/usr/src/sys/boot/zfs/../.. -I. -I/usr/src/sys/boot/zfs/../../../lib/libstand -I/usr/src/sys/boot/zfs/../../cddl/boot/zfs -ffreestanding -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -Wformat -Wall -DNDEBUG -std=gnu99 -Qunused-arguments -c /usr/src/sys/boot/zfs/zfs.c -o zfs.o >> In file included from /usr/src/sys/boot/zfs/zfs.c:48: >> /usr/src/sys/boot/zfs/zfsimpl.c:2033:19: warning: array index 264 is past the end of the array (which contains 192 elements) [-Warray-bounds] >> memcpy(path, &dn.dn_bonus[sizeof(znode_phys_t)], >> ^ ~~~~~~~~~~~~~~~~~~~~ >> /usr/src/sys/boot/zfs/../../cddl/boot/zfs/zfsimpl.h:788:2: note: array 'dn_bonus' declared here >> uint8_t dn_bonus[DN_MAX_BONUSLEN - sizeof (blkptr_t)]; >> ^ >> >> I don't have a zfs-powered machine, so I'm not sure whether this >> warning is false-positive or not. > > I'm seeing the same warnings trying to build HEAD r242903 with > clang on amd64. Andriy CCed. I believe that there is no actual problem there. -- Andriy Gapon