Linux Manual Pages development
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: Siegfried Ehlert <SiegEhl@netscape.net>
Cc: linux-man@vger.kernel.org
Subject: Re: Error in manual page memcpy(3)
Date: Thu, 4 Jun 2026 13:03:03 +0200	[thread overview]
Message-ID: <aiFagMMoVEGdlJop@devuan> (raw)
In-Reply-To: <e53068f4-2541-4220-8571-47e3283bb01f@netscape.net>

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

Hi Siegfried,

On 2026-06-04T12:14:08+0200, Siegfried Ehlert wrote:
> An error has crept into the synopsis of the *memcpy(3)* manual page.
> Immediately after the opening bracket of the function name, the third
> argument is listed as "size_t n;". The same applies to the strncpy(3) and
> stpncpy(3) manual pages; there, too, the third argument appears immediately
> after the opening bracket.
> 
> *Example:
> *
> 
> 
>    SYNOPSIS
> 
> *#include <string.h>* *void *memcpy(*size_t n; *void */dest/*[restrict
> */n/*], const void */src/*[restrict */n/*],* *size_t */n/*);*

That's correct.

     void *memcpy(size_t n;
                  void dest[restrict n], const void src[restrict n], size_t n);

What you're seeing is a forward declaration of the third parameter.
This is necessary so that it can be used in the array length expressions
in the declarators of the first and second parameters, since the third
parameter hasn't been declared yet.  This is an old GNU extension, and
is documented at the bottom of this page of the GCC manual:
<https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html>


Have a lovely day!
Alex

> 
> Kind regards
> Siegfried

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

           reply	other threads:[~2026-06-04 11:03 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <e53068f4-2541-4220-8571-47e3283bb01f@netscape.net>]

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=aiFagMMoVEGdlJop@devuan \
    --to=alx@kernel.org \
    --cc=SiegEhl@netscape.net \
    --cc=linux-man@vger.kernel.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