public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org,
	libc-alpha@sourceware.org,
	Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: Re: [PATCH 00/17] man3: SYNOPSIS: Use 'restrict' in prototypes
Date: Sat, 13 Mar 2021 11:41:49 +0100	[thread overview]
Message-ID: <f7284c58-993e-4dac-82af-7a2383a13dd7@gmail.com> (raw)
In-Reply-To: <YEw7i0CCDyvm/KAu@google.com>

Hi Jonathan,

On 3/13/21 5:11 AM, Jonathan Nieder wrote:
> Hi,
> 
> Alejandro Colomar wrote:
> 
>> This fixes the remaining pages. With this, all pages have been fixed to use
>> 'restrict'.
> 
> Probably the context for this came earlier, but I didn't see it in the
> commit message, I figure I should ask:

The origin is here:
<https://lore.kernel.org/linux-man/5a8997be-479b-d813-ce7a-558a8e6633e9@gmx.de/T/>

And a later (short) discussion about it is here:
<https://lore.kernel.org/linux-man/20210203194354.158439-1-alx.manpages@gmail.com/T/>

> 
> What is the benefit of getting this right for a human reader?  Does
> knowing which pointer arguments can't alias help them in tracking down
> some bugs, for example?  Or is it going to help them in some other
> way?

Yes, I think it will help fixing bugs, or more likely preventing them.
Think for example the case of memcpy(3) (by that time 'restrict' didn't 
exist), where people would incorrectly use it as if it were memmove(3) 
ignoring that it could be dangerous (see the NOTES section in memcpy(3)).


Cheers,

Alex

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

  reply	other threads:[~2021-03-13 10:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 22:33 Alejandro Colomar
2021-03-11 22:33 ` [PATCH 01/17] scanf.3: SYNOPSIS: Use 'restrict' in prototypes; ffix too Alejandro Colomar
2021-03-11 22:33 ` [PATCH 02/17] tsearch.3: SYNOPSIS: Use 'restrict' in prototypes Alejandro Colomar
2021-03-11 22:33 ` [PATCH 03/17] unlocked_stdio.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 04/17] wcpcpy.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 05/17] wcpncpy.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 06/17] wcrtomb.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 07/17] wcscat.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 08/17] wcscpy.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 09/17] wcsncat.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 10/17] wcsncpy.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 11/17] wcsnrtombs.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 12/17] wcsrtombs.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 13/17] wcstoimax.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 14/17] wcstok.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 15/17] wcstombs.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 16/17] wmemcpy.3: " Alejandro Colomar
2021-03-11 22:33 ` [PATCH 17/17] wordexp.3: " Alejandro Colomar
2021-03-13  4:11 ` [PATCH 00/17] man3: " Jonathan Nieder
2021-03-13 10:41   ` Alejandro Colomar (man-pages) [this message]
2021-03-14 20:56 ` Michael Kerrisk (man-pages)

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=f7284c58-993e-4dac-82af-7a2383a13dd7@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=xypron.glpk@gmx.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).