Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Dec 2011 13:28:51 +0000
From:      David Chisnall <theraven@theravensnest.org>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        Alexander Best <arundel@freebsd.org>, freebsd-toolchain@freebsd.org, current@freebsd.org, freebsd-arch@freebsd.org
Subject:   Re: [rfc] removing/conditionalising WERROR= in Makefiles
Message-ID:  <DE9D56F1-6D30-42E1-AA07-535BFAB2509D@theravensnest.org>
In-Reply-To: <4EFDB76C.1030901@FreeBSD.org>
References:  <20111226101040.GA6361@freebsd.org> <4EFDB76C.1030901@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DE9D56F1-6D30-42E1-AA07-535BFAB2509D>