Date: Wed, 11 Jul 2012 09:39:00 +0200 From: Dimitry Andric <dim@FreeBSD.org> To: Pedro Giffuni <pfg@FreeBSD.org> Cc: freebsd-current@FreeBSD.org Subject: Re: [CFT] Add -Wbounded to gcc Message-ID: <4FFD2D94.9040805@FreeBSD.org> In-Reply-To: <4FFCF5F8.6060104@FreeBSD.org> References: <4FFCF5F8.6060104@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2012-07-11 05:41, Pedro Giffuni wrote: > I have a patch from OpenBSD that adds -Wbounded to gcc: > > http://people.freebsd.org/~pfg/patches/patch-gcc-bounded > > Unfortunately it breaks world, or at least binutils, at this time: > > _________ > ... > cc1: warnings being treated as errors > peigen.c: In function '_bfd_pei_swap_aux_in': > peigen.c:241: warning: array size (14) smaller than bound length (18) > peigen.c:241: warning: array size (14) smaller than bound length (18) > peigen.c: In function '_bfd_pei_swap_aux_out': > peigen.c:314: warning: array size (14) smaller than bound length (18) > peigen.c:314: warning: array size (14) smaller than bound length (18) > *** Error code 1 > > Stop in /usr/src/gnu/usr.bin/binutils/libbfd. > *** Error code 1 > > Stop in /usr/src/gnu/usr.bin/binutils. > ___________ > > OpenBSD has a fix but before attempting to clean this, and whatever > else would break, I can't help but ask: is it worth it? Does it catch any really interesting bound overruns? If the number of false positives is very large, then it generally isn't worth the pain. Or the option should be turned off by default, and only enabled for WARNS=some_arbitrary_high_number. That said, fixing binutils (and particularly libbfd, which is what you are seeing here) is rather hopeless, it should be compiled with a low WARNS= setting anyway. :)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FFD2D94.9040805>