public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Wilco Dijkstra via Libc-alpha <libc-alpha@sourceware.org>
Cc: Noah Goldstein <goldstein.w.n@gmail.com>,
	 Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Subject: Re: [PATCH v2 3/7] string/test-str*cmp: remove stupid_[strcmp, strncmp, wcscmp, wcsncmp].
Date: Mon, 10 Jan 2022 13:42:31 +0100	[thread overview]
Message-ID: <87zgo3yd6w.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <AS8PR08MB6534E9868247E248757BE0D183509@AS8PR08MB6534.eurprd08.prod.outlook.com> (Wilco Dijkstra via Libc-alpha's message of "Mon, 10 Jan 2022 11:42:43 +0000")

* Wilco Dijkstra via Libc-alpha:

> Hi Noah,
>
>> These implementations are incorrect. There may be a mismatch in s1/s2
>> before invalid memory but no null CHAR / length boundary.
>
> This is not true, see
> eg. https://en.cppreference.com/w/cpp/string/byte/strcmp.  Most string
> functions require that the string is correctly terminated. There are
> only a few exceptions (memchr IIRC), and several generic
> implementations use strlen or strnlen before the main loop.

I am not sure if those are bugs.  Don't we support non-array usage in
these functions as an extension?  At least for strncmp and strnlen and
their wide counterparts.  C11 is pretty clear that strncmp operates on
arrays, so this is an extension.

Thanks,
Florian


  reply	other threads:[~2022-01-10 12:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 11:42 Wilco Dijkstra
2022-01-10 12:42 ` Florian Weimer [this message]
2022-01-10 13:09   ` Wilco Dijkstra
2022-01-10 13:16     ` Florian Weimer
2022-01-10 13:56       ` Wilco Dijkstra
2022-01-10 18:39 ` Noah Goldstein
2022-01-10 21:38 ` Noah Goldstein
  -- strict thread matches above, loose matches on Subject: below --
2022-01-09 12:29 [PATCH v1 1/5] x86: Optimize strcmp-avx2.S and fix for [BZ# 28755] Noah Goldstein
2022-01-10  0:27 ` [PATCH v2 1/7] x86: Fix __wcsncmp_avx2 in strcmp-avx2.S " Noah Goldstein
2022-01-10  0:27   ` [PATCH v2 3/7] string/test-str*cmp: remove stupid_[strcmp, strncmp, wcscmp, wcsncmp] Noah Goldstein
2022-01-10  0:37     ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgo3yd6w.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=goldstein.w.n@gmail.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).