[LLVMbugs] [Bug 10937] New: -Warray-bounds gives false positive on ICU
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Sep 15 14:59:50 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=10937
Summary: -Warray-bounds gives false positive on ICU
Product: clang
Version: unspecified
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: nicolasweber at gmx.de
CC: llvmbugs at cs.uiuc.edu
Repro:
thakis-macbookpro:src thakis$ cat test_array_bounds.c
void f() {
unsigned char in[1024];
unsigned short iv[2];
((char*)iv)[3] = in[3];
}
thakis-macbookpro:src thakis$ clang -c test_array_bounds.c
test_array_bounds.c:4:11: warning: array index of '3' indexes past the end of
an array (that contains 2 elements) [-Warray-bounds]
((char*)iv)[3] = in[3];
^ ~
test_array_bounds.c:3:3: note: array 'iv' declared here
unsigned short iv[2];
^
1 warning generated.
Here's the full warning from ICU:
third_party/nss/mozilla/security/nss/lib/freebl/desblapi.c:173:15: warning:
array index of '3' indexes past the end of an array (that contains 2 elements)
[-Warray-bounds]
COPY8BTOHALF(cx->iv, in);
~~~~~~~~~~~~~^~~~~~~~~~~
third_party/nss/mozilla/security/nss/lib/freebl/desblapi.c:80:39: note:
expanded from:
#define COPY8BTOHALF(to, from) COPY8B(to, from, from)
^
third_party/nss/mozilla/security/nss/lib/freebl/desblapi.c:73:14: note:
expanded from:
BYTEPTR(to)[3] = BYTEPTR(from)[3]; \
^ ~
third_party/nss/mozilla/security/nss/lib/freebl/des.h:52:30: note: expanded
from:
#define BYTEPTR(x) ((BYTE *)(x))
^
third_party/nss/mozilla/security/nss/lib/freebl/des.h:67:5: note: array 'iv'
declared here
HALF iv [2];
^
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list