public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: mtk.manpages@gmail.com
Cc: Alejandro Colomar <alx.manpages@gmail.com>,
	linux-man@vger.kernel.org, libc-alpha@sourceware.org
Subject: [PATCH 19/24] strtod.3: SYNOPSIS: Use 'restrict' in prototypes
Date: Wed, 10 Mar 2021 19:31:45 +0100	[thread overview]
Message-ID: <20210310183149.194717-20-alx.manpages@gmail.com> (raw)
In-Reply-To: <20210310183149.194717-1-alx.manpages@gmail.com>

Both POSIX and glibc use 'restrict' in strtod(), strtof(), strtold().
Let's use it here too.

.../glibc$ grep_glibc_prototype strtod
stdlib/stdlib.h:117:
extern double strtod (const char *__restrict __nptr,
		      char **__restrict __endptr)
     __THROW __nonnull ((1));
.../glibc$ grep_glibc_prototype strtof
stdlib/stdlib.h:123:
extern float strtof (const char *__restrict __nptr,
		     char **__restrict __endptr) __THROW __nonnull ((1));
.../glibc$ grep_glibc_prototype strtold
stdlib/stdlib.h:126:
extern long double strtold (const char *__restrict __nptr,
			    char **__restrict __endptr)
     __THROW __nonnull ((1));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/strtod.3 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/man3/strtod.3 b/man3/strtod.3
index e77bd59ec..24cb4ad13 100644
--- a/man3/strtod.3
+++ b/man3/strtod.3
@@ -49,9 +49,10 @@ strtod, strtof, strtold \- convert ASCII string to floating-point number
 .nf
 .B #include <stdlib.h>
 .PP
-.BI "double strtod(const char *" nptr ", char **" endptr );
-.BI "float strtof(const char *" nptr ", char **" endptr );
-.BI "long double strtold(const char *" nptr ", char **" endptr );
+.BI "double strtod(const char *restrict " nptr ", char **restrict " endptr );
+.BI "float strtof(const char *restrict " nptr ", char **restrict " endptr );
+.BI "long double strtold(const char *restrict " nptr \
+", char **restrict " endptr );
 .fi
 .PP
 .RS -4
-- 
2.30.1.721.g45526154a5


  parent reply	other threads:[~2021-03-10 18:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 18:31 [PATCH 00/24] man3: SYNOPSIS: Use 'restrict' in prototypes (batch 5) Alejandro Colomar
2021-03-10 18:31 ` [PATCH 01/24] sem_getvalue.3: SYNOPSIS: Use 'restrict' in prototypes Alejandro Colomar
2021-03-10 18:31 ` [PATCH 02/24] sem_wait.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 03/24] setaliasent.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 04/24] setbuf.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 05/24] " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 06/24] setnetgrent.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 07/24] sigwait.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 08/24] statvfs.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 09/24] stpcpy.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 10/24] stpncpy.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 11/24] strcat.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 12/24] strcpy.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 13/24] strfmon.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 14/24] strftime.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 15/24] string.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 16/24] " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 17/24] strptime.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 18/24] strsep.3: " Alejandro Colomar
2021-03-10 18:31 ` Alejandro Colomar [this message]
2021-03-10 18:31 ` [PATCH 20/24] strtoimax.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 21/24] strtok.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 22/24] strtol.3, strtoul.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 23/24] strxfrm.3: " Alejandro Colomar
2021-03-10 18:31 ` [PATCH 24/24] swab.3: " Alejandro Colomar
2021-03-14 20:51 ` [PATCH 00/24] man3: SYNOPSIS: Use 'restrict' in prototypes (batch 5) Michael Kerrisk (man-pages)
2021-03-14 20:53   ` Michael Kerrisk (man-pages)
2021-03-19 21:08     ` Alejandro Colomar (man-pages)
2021-03-19 20:59   ` Alejandro Colomar (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=20210310183149.194717-20-alx.manpages@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /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).