diff options
author | Paul Bolle <pebolle@tiscali.nl> | 2013-02-08 07:57:55 +0100 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-02-22 13:53:31 +0100 |
commit | f24b697ba499f971e84478f531de77ede9a2aac1 (patch) | |
tree | 2645c9ffffed1c9aa46fee4eae67c2580ebd4d02 /lib/dump_stack.c | |
parent | [SCSI] qla2xxx: Update the copyright information. (diff) | |
download | linux-f24b697ba499f971e84478f531de77ede9a2aac1.tar.xz linux-f24b697ba499f971e84478f531de77ede9a2aac1.zip |
[SCSI] qla2xxx: silence two GCC warnings.
Compiling qla_gs.o (part of the qla2xxx module) triggers two GCC
warnings:
drivers/scsi/qla2xxx/qla_gs.c: In function ‘qla2x00_fdmi_rhba’:
drivers/scsi/qla2xxx/qla_gs.c:1339:7: warning: array subscript is above array bounds [-Warray-bounds]
drivers/scsi/qla2xxx/qla_gs.c: In function ‘qla2x00_fdmi_register’:
drivers/scsi/qla2xxx/qla_gs.c:1663:15: warning: array subscript is above array bounds [-Warray-bounds]
It seems that the sequence of a strcpy followed by a strlen confuses GCC
when it is keeping track of array bounds here. (It is not clear to me
which array triggers this warning and by how much GCC thinks the
subscript is above its bounds. Neither is it clear to me why comparable
code in these two functions doesn't trigger this warning.)
An easy way to silence these warnings is to use preprocessor macros and
strncpy, as that apparently gives GCC enough information to keep track
of array bounds.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'lib/dump_stack.c')
0 files changed, 0 insertions, 0 deletions