From owner-freebsd-arch@FreeBSD.ORG Fri Dec 30 14:08:35 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5270106564A; Fri, 30 Dec 2011 14:08:35 +0000 (UTC) (envelope-from theraven@theravensnest.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5F08FC0C; Fri, 30 Dec 2011 14:08:35 +0000 (UTC) Received: from [192.168.0.2] (cpc2-cwma5-0-0-cust875.7-3.cable.virginmedia.com [86.11.39.108]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id pBUDSpdF032333 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 30 Dec 2011 13:28:51 GMT (envelope-from theraven@theravensnest.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: David Chisnall In-Reply-To: <4EFDB76C.1030901@FreeBSD.org> Date: Fri, 30 Dec 2011 13:28:51 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20111226101040.GA6361@freebsd.org> <4EFDB76C.1030901@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1251.1) 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-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2011 14:08:36 -0000 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). =20 I suspect a lot of similar warnings are caused by the difference in = default dialects between clang and gcc. Adding an explicit -std=3Dc89 = to the cflags any modules that are using an archaic dialect of C may = silence a lot of these... David=