Skip to contentSkip to conversation

2.6.27: "array subscript is above array bounds" warnings

DISCUSSION Oliver Bock 3 participants 3 messages Oct 14, 2008 – Oct 18, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

Hi all,

FYI, I just came across the following warnings when compiling 2.6.27 (release) using gcc 4.3.2 (Debian 4.3.2-1) on Debian Lenny (i386):

----------
drivers/acpi/tables/tbfadt.c: In function ‘acpi_tb_create_local_fadt’:
include/asm/string_32.h:75: warning: array subscript is above array bounds

drivers/usb/core/hcd.c: In function ‘usb_hcd_poll_rh_status’:
include/asm/string_32.h:75: warning: array subscript is above array bounds

fs/xfs/xfs_mount.c: In function ‘xfs_mod_sb’:
fs/xfs/xfs_mount.c:1456: warning: array subscript is above array bounds
----------

Cheers,
Oliver

#1 lore raw

(cc's added)

Quoted 15 lines · On Tue, 14 Oct 2008 22:17:36 +0200 Oliver Bock <[email protected]> wrote:

Hi all,

FYI, I just came across the following warnings when compiling 2.6.27 (release) using gcc 4.3.2 (Debian 4.3.2-1) on Debian Lenny (i386):

----------
drivers/acpi/tables/tbfadt.c: In function ___acpi_tb_create_local_fadt___:
include/asm/string_32.h:75: warning: array subscript is above array bounds

drivers/usb/core/hcd.c: In function ___usb_hcd_poll_rh_status___:
include/asm/string_32.h:75: warning: array subscript is above array bounds

fs/xfs/xfs_mount.c: In function ___xfs_mod_sb___:
fs/xfs/xfs_mount.c:1456: warning: array subscript is above array bounds
----------

#2 lore raw
Quoted 8 lines · Andrew Morton

(cc's added)

Quoted 4 lines · On Tue, 14 Oct 2008 22:17:36 +0200 Oliver Bock <[email protected]> wrote:

Hi all,

FYI, I just came across the following warnings when compiling 2.6.27 (release) using gcc 4.3.2 (Debian 4.3.2-1) on Debian Lenny (i386):

...

Quoted 2 lines
Quoted 2 lines

drivers/usb/core/hcd.c: In function ___usb_hcd_poll_rh_status___:
include/asm/string_32.h:75: warning: array subscript is above array bounds

Does this refer to the call to memcpy() in usb_hcd_poll_rh_status()?

Line 75 in string_32.h is part of the __constant_memcpy() function. That function should not be involved here because the length argument isn't a compile-time constant.

This has to be either a compiler bug or else a bug in the implementation of memcpy.

Alan Stern