Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 17 Jul 2023 13:22:05 -0300
From: Adhemerval Zanella Netto <adhemerval.zanella@...aro.org>
To: musl@...ts.openwall.com, Robert Clausecker <fuz@....su>
Subject: Re: strcmp() guarantees and assumptions



On 16/07/23 18:13, Robert Clausecker wrote:
> Hi Markus,
> 
>> Also, glibc already has an SSE strcmp implementation you may want to
>> look at.
> 
> I'm not going to look at glibc as it's LGPL licensed.  I am aware of the
> Intel implementation, but I don't like that it has to duplicate the code
> 16 times for each possible misalignment pattern.  Without having to
> ensure that a cacheline of data is only touched once we confirm there
> is no previous mismatch, it might be possible to write simpler code, but
> I'm currently not entirely sure how.

On glibc side we have discussed the requirement of null-terminated for
string functions on some occasions [1][2][3] and we leaned toward allows
non-null terminated buffers for strncmp (where implementations must stop
are either first null or the at end of the buffer) and require 
null-terminated buffers for strcmp.

[1] https://sourceware.org/pipermail/libc-alpha/2023-February/145840.html
[2] https://sourceware.org/pipermail/libc-alpha/2023-February/145860.html
[3] https://sourceware.org/pipermail/libc-alpha/2023-February/145907.html

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.