This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12019] memchr overshoots on Alpha
- From: "bonzini at gnu dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 15 Sep 2010 08:06:13 -0000
- Subject: [Bug libc/12019] memchr overshoots on Alpha
- References: <20100914154213.12019.eblake@redhat.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From bonzini at gnu dot org 2010-09-15 08:06 -------
Andreas,
7.22.5 of ISO/IEC 9899:201x (the description of memchr) never refers to S as
being an array.
Compare:
7.20.6.5. The snprintf function [...] The snprintf function is equivalent to
fprintf, except that the output is written into an array (specified by argument
s) rather than to a stream.
7.22.5. The memchr function locates the first occurrence of c (converted to an
unsigned char) in the initial n characters (each interpreted as unsigned char)
of the object pointed to by s.
Besides, even if your interpretation was correct, going beyond what the standard
promises would have other advantages. For example: 1) consistency, as the
manual specifies that "rawmemchr (str, '\0') will never go beyond the end of the
string; 2) ease of implementing rawmemchr specially for the Alpha, based on the
Alpha memchr.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=12019
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.