Pedro Giffuni | 11 Jul 2012 05:41
Picon
Favicon

[CFT] Add -Wbounded to gcc

Hello;

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?

best regards,

(Continue reading)

Steve Kargl | 11 Jul 2012 06:16
Picon

Re: [CFT] Add -Wbounded to gcc

On Tue, Jul 10, 2012 at 10:41:44PM -0500, 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?
> 

IMHO, no.
(Continue reading)

Dimitry Andric | 11 Jul 2012 09:39
Picon
Favicon

Re: [CFT] Add -Wbounded to gcc

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
(Continue reading)

Pedro Giffuni | 11 Jul 2012 18:12
Picon
Favicon

Re: [CFT] Add -Wbounded to gcc


--- Mer 11/7/12, Dimitry Andric <dim <at> FreeBSD.org> ha scritto:
...
> 
> Does it catch any really interesting bound overruns?
> 

Nah .. I arrived to the conclusion that it's not
really worth it :).

> 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.
> 

It is nice to have but I don't think we should turn it on
for any level. I will have to look at how to do that.

Thanks,

Pedro.

_______________________________________________
freebsd-current <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe <at> freebsd.org"

(Continue reading)


Gmane