public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: enh <enh@google.com>
To: Zack Weinberg <zack@owlfolio.org>
Cc: Ralf Jung <post@ralfj.de>,
	Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
	 GNU libc development <libc-alpha@sourceware.org>
Subject: Re: Support for memcpy with equal source and destination
Date: Mon, 27 Nov 2023 07:02:26 -0800	[thread overview]
Message-ID: <CAJgzZoof0fp=3L3e+Av2rPXh_rkAM=WNwznRyg=ms2nJ4n+j2w@mail.gmail.com> (raw)
In-Reply-To: <b1096608-56e5-46a9-b40b-c793a71e87ff@app.fastmail.com>

On Mon, Nov 27, 2023 at 6:54 AM Zack Weinberg <zack@owlfolio.org> wrote:
>
> 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_.)

fwiw, bionic doesn't use `restrict` at all in headers, and no human or
compiler has noticed yet.

> zw

  reply	other threads:[~2023-11-27 15:02 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
2023-11-27 15:02     ` enh [this message]
  -- 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='CAJgzZoof0fp=3L3e+Av2rPXh_rkAM=WNwznRyg=ms2nJ4n+j2w@mail.gmail.com' \
    --to=enh@google.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=libc-alpha@sourceware.org \
    --cc=post@ralfj.de \
    --cc=zack@owlfolio.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).