while working on an optimized version of strnlen, some string tests fail

Adhemerval Zanella adhemerval.zanella@linaro.org
Thu Nov 17 18:53:00 GMT 2016



On 17/11/2016 16:27, Nam-goo Lee wrote:
> Hi.
> 
> I'm working on an optimized version of strnlen function for arm.
> But following tests fail, and I'm stuck here finding the reasons for
> the failure.
> 
> FAIL: string/stratcliff
> FAIL: string/test-stpncpy
> FAIL: string/test-strncpy
> Summary of test results:
>       3 FAIL
>      57 PASS
> 
> I'm surprised to see that tests for functions other than strnlen fail.
> I'd really appreciate to get some hints on what the 'stratcliff' test does,
> and the reasons for the failure.
> Attached my code.
> 
> Thanks.
> 

Hi,

ARM uses default string/str{n,p}cpy.c code and strncpy code has:

 26 char *
 27 STRNCPY (char *s1, const char *s2, size_t n)
 28 {
 29   size_t size = __strnlen (s2, n);

So if your optimized strnlen does not provide the expected correct result
the code will potentially fail.  It might the case where it is stressing
a case that test-strnlen does not issue.  Either way, you need to a full 
clean make check to make sure the implementation is ready for upstream review.



More information about the Libc-help mailing list