[BUILDROBOT] m68k-linux: gas: array subscript is below array bounds

Jan-Benedict Glaw jbglaw@lug-owl.de
Sun Aug 24 02:31:00 GMT 2014


Hi!

After updating gcc on one of the builders, I found a build
(http://toolchain.lug-owl.de/buildbot/show_build_details.php?id=345664)
where gcc complained:

gcc -DHAVE_CONFIG_H -I. -I/home/vaxbuild/repos/binutils_gdb/gas  -I. -I/home/vaxbuild/repos/binutils_gdb/gas -I../bfd -I/home/vaxbuild/repos/binutils_gdb/gas/config -I/home/vaxbuild/repos/binutils_gdb/gas/../include -I/home/vaxbuild/repos/binutils_gdb/gas/.. -I/home/vaxbuild/repos/binutils_gdb/gas/../bfd -DLOCALEDIR="\"/home/vaxbuild/build/m68k-linux/_install_/share/locale\""  -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT tc-m68k.o -MD -MP -MF .deps/tc-m68k.Tpo -c -o tc-m68k.o `test -f 'config/tc-m68k.c' || echo '/home/vaxbuild/repos/binutils_gdb/gas/'`config/tc-m68k.c
/home/vaxbuild/repos/binutils_gdb/gas/config/tc-m68k.c: In function ‘md_assemble’:
/home/vaxbuild/repos/binutils_gdb/gas/config/tc-m68k.c:4514:36: error: array subscript is below array bounds [-Werror=array-bounds]
   n = (the_ins.numo - the_ins.fragb[n - 1].fragoff);
                                    ^
cc1: all warnings being treated as errors
make[3]: *** [tc-m68k.o] Error 1


On a first glance, the error could be correct for the first loop with
n=0. OTOH, this code is some 15 years old and seems to be working.
(And it's too early in the morning *cough*.)  So this is just a
heads-up, maybe totally bogus.

MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
Signature of: "Debugging is twice as hard as writing the code in the first place.
the second  :  Therefore, if you write the code as cleverly as possible, you are,
               by definition, not smart enough to debug it." - Brian W. Kernighan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://sourceware.org/pipermail/binutils/attachments/20140824/04948cd2/attachment.sig>


More information about the Binutils mailing list