This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/16554] New: memset incorrect for negative signed char
- From: "geoff at dyalog dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 11 Feb 2014 12:06:19 +0000
- Subject: [Bug libc/16554] New: memset incorrect for negative signed char
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=16554
Bug ID: 16554
Summary: memset incorrect for negative signed char
Product: glibc
Version: 2.13
Status: NEW
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: geoff at dyalog dot com
CC: drepper.fsp at gmail dot com
memset() for the ARM does not honour the "converted to an unsigned char"
required by 7.21.6.1 of ISO/IEC 9899:1999(E)
signed char smallint = -3;
signed char smallarray[10];
memset(smallarray, smallint, 10);
results in smallarray[0] ââ -3
smallarray[1] ââ -1
smallarray[2] ââ -1
smallarray[3] ââ -1
smallarray[4] ââ -3
...
code widens the smallint of -3 to int with sign extension - correctly. memset()
fails to AND this with 0xff before shifting and ORing.
--
You are receiving this mail because:
You are on the CC list for the bug.