https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91830
Bug ID: 91830 Summary: Bogus -Warray-bounds warning compiling binutils Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: amodra at gmail dot com Target Milestone: --- x86_64-linux, gcc r275988. /home/alan/src/binutils-gdb/bfd/mach-o.c: In function ‘bfd_mach_o_init_segment’: /home/alan/src/binutils-gdb/bfd/mach-o.c:3137:3: error: ‘strcpy’ offset 24 from the object at ‘cmd’ is out of the bounds of referenced subobject ‘segname’ with type ‘char[17]’ at offset 0 [-Werror=array-bounds] 3137 | strcpy (seg->segname, segname); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/alan/src/binutils-gdb/bfd/mach-o.c:26: /home/alan/src/binutils-gdb/bfd/mach-o.h:94:8: note: subobject ‘segname’ declared here 94 | char segname[BFD_MACH_O_SEGNAME_SIZE + 1]; | ^~~~~~~