From owner-freebsd-current@FreeBSD.ORG Sat Dec 1 10:59:49 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 5C6C9DA0; Sat, 1 Dec 2012 10:59:49 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0A77D8FC12; Sat, 1 Dec 2012 10:59:48 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so1737789oag.13 for ; Sat, 01 Dec 2012 02:59:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=d90B+Gh54rRY8BYC3JCRhU/uBY2o1vS72w3vI2kCrOs=; b=NJFC5bDZfSQPI/TF1pU1LgwMcR360tpSeS7dAhfNyr2WpY25LepF96chZfaClOv2zt 62ltbPcZvSVCTwtaUHnQJcYK01bR+aW6ksDijZ+FwLNh4+SM+qgtlphxP72MJpajxfhb XHmDizNFZaFrKl3y7v7jzghfsa+mdCQIs2tAC7U+ka9H2DYL1ulCPgUnfHTa/ioKuBsa ez0Y4MceM6zYfKaMozeSvohHNGRUJhGbsOKgjNb1EINkOOJQO8sNvkgYaGw9TkvYHUwT HAblWtnkTPGMqwQcXKj+6eUC0s/xx/bFRrM/JmM/ioN+i66cgKQfxmnuvTPnIz9V7Sp7 YljA== MIME-Version: 1.0 Received: by 10.60.170.114 with SMTP id al18mr3643209oec.56.1354359588575; Sat, 01 Dec 2012 02:59:48 -0800 (PST) Received: by 10.76.143.33 with HTTP; Sat, 1 Dec 2012 02:59:48 -0800 (PST) In-Reply-To: <20120703102142.6554b10e.taku@tackymt.homeip.net> References: <20120703102142.6554b10e.taku@tackymt.homeip.net> Date: Sat, 1 Dec 2012 02:59:48 -0800 Message-ID: Subject: Re: A suspicious warning in sys/boot/zfs/zfsimpl.c From: Garrett Cooper To: Taku YAMAMOTO Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, Andriy Gapon 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 10:59:49 -0000 On Mon, Jul 2, 2012 at 6:21 PM, Taku YAMAMOTO wro= te: > When I built the world as of r237813, clang reported a warning which > caught my attention. > > =3D=3D=3D> sys/boot/zfs (all) > clang -O2 -pipe -march=3Dpentium4 -DBOOTPROG=3D\"zfsloader\" -I/usr/src/= sys/boot/zfs/../common -I/usr/src/sys/boot/zfs/../.. -I. -I/usr/src/sys/boo= t/zfs/../../../lib/libstand -I/usr/src/sys/boot/zfs/../../cddl/boot/zfs -ff= reestanding -mpreferred-stack-boundary=3D2 -mno-mmx -mno-3dnow -mno-sse -mn= o-sse2 -mno-sse3 -msoft-float -Wformat -Wall -DNDEBUG -std=3Dgnu99 -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_ph= ys_t)], > ^ ~~~~~~~~~~~~~~~= ~~~~~ > /usr/src/sys/boot/zfs/../../cddl/boot/zfs/zfsimpl.h:788:2: note: array 'd= n_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. Thanks, -Garrett