Skip to contentSkip to conversation

fs/xfs/xfs_mount.c:1483: warning: array subscript is above array bounds

DISCUSSION Geert Uytterhoeven 2 participants 2 messages May 5, 2009

lore
Share & tools
lore
#0 lore raw

http://kisskb.ellerman.id.au/kisskb/buildresult/407608/:
fs/xfs/xfs_mount.c:1483: warning: array subscript is above array bounds

xfs_mod_sb(xfs_trans_t *tp, __int64_t fields)

{
	xfs_sb_field_t  f;

	...
	first = xfs_sb_info[f].offset;
	...
}

xfs_sb_field_t is an enum with 47 values.
xfs_sb_info[] has at least 47 entries.

Is this a bogus warning?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#1 lore raw
Quoted 13 lines · Geert Uytterhoeven

http://kisskb.ellerman.id.au/kisskb/buildresult/407608/:
fs/xfs/xfs_mount.c:1483: warning: array subscript is above array bounds

xfs_mod_sb(xfs_trans_t *tp, __int64_t fields)

{
	xfs_sb_field_t  f;

	...
	first = xfs_sb_info[f].offset;
	...
}
Quoted 2 lines

xfs_sb_field_t is an enum with 47 values.
xfs_sb_info[] has at least 47 entries.

That's the conclusion I came to. I also see similar bogus warnings in
a couple of other places in a full kernel build (not in xfs).