This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH][AArch64] Add rawmemchr
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, Alexander Cherepanov <ch3root at openwall dot com>, 'GNU C Library' <libc-alpha at sourceware dot org>
- Cc: <nd at arm dot com>
- Date: Thu, 2 Jun 2016 15:22:47 +0100
- Subject: Re: [PATCH][AArch64] Add rawmemchr
- Authentication-results: sourceware.org; auth=none
- Nodisclaimer: True
- References: <AM3PR08MB00888F05E81BE0117C6876AB83420 at AM3PR08MB0088 dot eurprd08 dot prod dot outlook dot com>,<57502FC8 dot 5040804 at openwall dot com> <AM3PR08MB0088064567DB75A8002F459483580 at AM3PR08MB0088 dot eurprd08 dot prod dot outlook dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
On 02/06/16 14:48, Wilco Dijkstra wrote:
> Alexander Cherepanov wrote:
>> Is memchr on your arch guaranteed to work with an infinite size?
> Yes it works fine. The AArch64 assembler functions have been carefully
> written to avoid overflows on the size as well as end-pointer comparisons.
note that the libc implementation would not help
if the compiler assumed infinite size was ub..
the call would be dead code eliminated.
(which is why the compiler should not try to be
smart about library apis, the libc implementor
may want to give stricter guarantees.. this is
a common problem with gcc.)