From: "Zack Weinberg" <zack@owlfolio.org>
To: "Ralf Jung" <post@ralfj.de>, "Wilco Dijkstra" <Wilco.Dijkstra@arm.com>
Cc: "GNU libc development" <libc-alpha@sourceware.org>
Subject: Re: Support for memcpy with equal source and destination
Date: Mon, 27 Nov 2023 09:53:45 -0500 [thread overview]
Message-ID: <b1096608-56e5-46a9-b40b-c793a71e87ff@app.fastmail.com> (raw)
In-Reply-To: <5dc45a47-3266-4ae6-80ec-17601be8454a@ralfj.de>
On Mon, Nov 27, 2023, at 9:45 AM, Ralf Jung wrote:
>> Paul's example was to show that with restrict you could write a conformant
>> C implementation. I think it is sufficient to cast away restrict without adding an
>> extra branch (the existing generic C version does this).
>
> I don't think it is possible to cast away restrict. The restrict rules apply to
> all pointers derived from the restrict pointer.
As a practical matter, if we remove restrict annotations from the public memcpy
declaration in string.h, _someone_ is going to think that's a bug, and also I
wouldn't be surprised if future compilers started complaining about mismatches
with their internal prototype. (Neither GCC 13 nor clang 16 does this _now_.)
zw
next prev parent reply other threads:[~2023-11-27 14:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-27 14:38 Wilco Dijkstra
2023-11-27 14:45 ` Ralf Jung
2023-11-27 14:53 ` Zack Weinberg [this message]
2023-11-27 15:02 ` enh
-- strict thread matches above, loose matches on Subject: below --
2023-11-27 19:28 Aaron Peter Bachmann
2023-11-27 19:39 ` Paul Eggert
2023-11-23 12:14 Adhemerval Zanella Netto
2023-11-25 7:48 ` Paul Eggert
2023-11-25 8:20 ` Ralf Jung
2023-11-25 17:11 ` Paul Eggert
2023-11-27 11:15 ` Ralf Jung
2023-11-27 11:46 ` Alexander Monakov
2023-11-27 12:34 ` Ralf Jung
2023-11-27 14:25 ` Alexander Monakov
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=b1096608-56e5-46a9-b40b-c793a71e87ff@app.fastmail.com \
--to=zack@owlfolio.org \
--cc=Wilco.Dijkstra@arm.com \
--cc=libc-alpha@sourceware.org \
--cc=post@ralfj.de \
/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).