From owner-freebsd-current@FreeBSD.ORG Fri Dec 30 17:04:58 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D0E51065670; Fri, 30 Dec 2011 17:04:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 283728FC19; Fri, 30 Dec 2011 17:04:58 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:408b:3bdd:8466:f24f] (unknown [IPv6:2001:7b8:3a7:0:408b:3bdd:8466:f24f]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id F0C3C5C37; Fri, 30 Dec 2011 18:04:56 +0100 (CET) Message-ID: <4EFDEF3B.4090200@FreeBSD.org> Date: Fri, 30 Dec 2011 18:04:59 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: David Chisnall References: <20111226101040.GA6361@freebsd.org> <4EFDB76C.1030901@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Alexander Best , freebsd-toolchain@freebsd.org, current@freebsd.org, freebsd-arch@freebsd.org Subject: Re: [rfc] removing/conditionalising WERROR= in Makefiles X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 30 Dec 2011 17:04:58 -0000 On 2011-12-30 14:28, David Chisnall wrote: > On 30 Dec 2011, at 13:06, Dimitry Andric wrote: > >> sys/gnu/fs/xfs/xfs_dir2_block.c:1149:17: warning: array index of '1' indexes past the end of an array (that contains 1 element) [-Warray-bounds] > > I recall some discussion of this warning on the clang list a few months ago, and I believe that it should now only appear if you are compiling in a C99 or C11 dialect mode (the rationale is that any variable-length structures in C99 should be using a zero-sized array as the final element, while C89 lacked any ability to do this). Yes, that is perfectly fine, but the xfs code defines the struct in question as follows: /* * Active entry in a data block. Aligned to 8 bytes. * Tag appears as the last 2 bytes. */ typedef struct xfs_dir2_data_entry { xfs_ino_t inumber; /* inode number */ __uint8_t namelen; /* name length */ __uint8_t name[1]; /* name bytes, no null */ /* variable offset */ xfs_dir2_data_off_t tag; /* starting offset of us */ } xfs_dir2_data_entry_t; E.g there *is* an overrun, but maybe it was really supposed to be like that. Meanwhile, upstream has apparently caught on: http://oss.sgi.com/archives/xfs/2011-07/msg00024.html