* [BUILDROBOT] m68k-linux: gas: array subscript is below array bounds
@ 2014-08-24 2:31 Jan-Benedict Glaw
2014-08-24 4:09 ` Alan Modra
0 siblings, 1 reply; 2+ messages in thread
From: Jan-Benedict Glaw @ 2014-08-24 2:31 UTC (permalink / raw)
To: binutils, Richard Henderson, Nick Clifton
[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]
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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [BUILDROBOT] m68k-linux: gas: array subscript is below array bounds
2014-08-24 2:31 [BUILDROBOT] m68k-linux: gas: array subscript is below array bounds Jan-Benedict Glaw
@ 2014-08-24 4:09 ` Alan Modra
0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2014-08-24 4:09 UTC (permalink / raw)
To: Jan-Benedict Glaw; +Cc: binutils, Richard Henderson, Nick Clifton
On Sun, Aug 24, 2014 at 04:31:14AM +0200, Jan-Benedict Glaw wrote:
> 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.
Looks like a false positive. The loop exits with n == the_ins.nfrag,
and we don't enter the loop in the first place if the_ins.nfrag == 0.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-24 4:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-24 2:31 [BUILDROBOT] m68k-linux: gas: array subscript is below array bounds Jan-Benedict Glaw
2014-08-24 4:09 ` Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).