public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
To: наб <nabijaczleweli@nabijaczleweli.xyz>
Cc: linux-man@vger.kernel.org,
	"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	"G. Branden Robinson" <g.branden.robinson@gmail.com>
Subject: Re: [PATCH v2 1/5] strdup.3: drop mention of "the GNU GCC suite"
Date: Wed, 15 Sep 2021 21:49:16 +0200	[thread overview]
Message-ID: <3635eb02-a6eb-5f61-3987-5ee4ad2e393f@gmail.com> (raw)
In-Reply-To: <89a40c652664dfc41425625d1ec5c15151e2e964.1631622750.git.nabijaczleweli@nabijaczleweli.xyz>

On 9/14/21 2:40 PM, наб wrote:
> str[n]dupa() are available on every modern compiler platform,
> incl. Clang, ICC, &c.
> 
> By shortening the third paragraph, it now reads
>      strdupa() and strndupa() are similar,
>      but use alloca(3) to allocate the buffer.
> pointing squarely to alloca(3), which is scary enough,
> so drop the extraneous warning, too ‒ athis clearly points to

(I fixed s/athis/this/)

> "see alloca(3) for the limitations of that allocator".
> 
> Plus, it's not like malloc(3) doesn't have its problems, too,
> but I don't see those being touted in the first paragraph;
> reducing these to the bare minimum,
>     strdup() copies into malloc(3) and you can free it with free(3),
>     strndup() likewise, but up to n, and
>     str[n]dupa() use alloca(3) instead ‒ be wary of what alloca(3) does!
> doesn't really make sense ‒ it's obvious that, ex definitione,
> alloca(3) suffers from alloca(3) problems and input limits,
> just like malloc(3) from the malloc(3) suite's.
> 
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>

наб, patch applied!

Thanks,

Alex

> ---
>   man3/strdup.3 | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/man3/strdup.3 b/man3/strdup.3
> index 1e1ac34de..963de7d48 100644
> --- a/man3/strdup.3
> +++ b/man3/strdup.3
> @@ -99,9 +99,6 @@ and
>   are similar, but use
>   .BR alloca (3)
>   to allocate the buffer.
> -They are available only when using the GNU
> -GCC suite, and suffer from the same limitations described in
> -.BR alloca (3).
>   .SH RETURN VALUE
>   On success, the
>   .BR strdup ()
> 


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

  reply	other threads:[~2021-09-15 19:49 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23 21:01 [PATCH 1/2] strdup.3: drop mention of "the GNU GCC suite" наб
2021-08-23 21:01 ` [PATCH 2/2] alloca.3: rewrite NOTES наб
2021-08-24  9:50   ` Michael Kerrisk (man-pages)
2021-08-24 10:04     ` G. Branden Robinson
2021-08-24 11:58       ` наб
2021-08-24 10:33     ` Alejandro Colomar (man-pages)
2021-08-24 11:18       ` Alejandro Colomar (man-pages)
2021-08-25 18:21       ` наб
2021-08-24 11:47     ` наб
2021-08-24  9:21 ` [PATCH 1/2] strdup.3: drop mention of "the GNU GCC suite" Michael Kerrisk (man-pages)
2021-08-24 10:28   ` наб
2021-08-24 10:40     ` Alejandro Colomar (man-pages)
2021-09-14 12:40 ` [PATCH v2 0/5] alloca(3) commentary re-write наб
2021-09-14 12:40   ` [PATCH v2 1/5] strdup.3: drop mention of "the GNU GCC suite" наб
2021-09-15 19:49     ` Alejandro Colomar (man-pages) [this message]
2021-09-14 12:41   ` [PATCH v2 2/5] alloca.3: clarify origins in CONFORMING TO наб
2021-09-15 19:49     ` Alejandro Colomar (man-pages)
2021-09-14 12:41   ` [PATCH v2 3/5] alloca.3: clarify reasoning for no error return in BUGS наб
2021-09-15 19:42     ` Alejandro Colomar (man-pages)
2021-09-17 20:35       ` наб
2025-10-29  8:42       ` G. Branden Robinson
2025-10-29 10:15         ` Alejandro Colomar
2025-10-29 10:30           ` G. Branden Robinson
2025-10-29 10:58             ` Alejandro Colomar
2025-10-29 11:12               ` G. Branden Robinson
2025-10-29 11:23                 ` Alejandro Colomar
2025-10-29 15:22         ` наб
2025-10-29 22:55           ` G. Branden Robinson
2021-09-14 12:41   ` [PATCH v2 4/5] alloca.3: remove GCC faffling from NOTES наб
2021-09-15 19:48     ` Alejandro Colomar (man-pages)
2021-09-17 20:45       ` наб
2021-09-19 19:39         ` Alejandro Colomar (man-pages)
2021-09-14 12:41   ` [PATCH v2 5/5] alloca.3: simplfy malloc(3) suite comparison, note VLAs наб

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=3635eb02-a6eb-5f61-3987-5ee4ad2e393f@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=g.branden.robinson@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=nabijaczleweli@nabijaczleweli.xyz \
    /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