[PATCH 19/24] strtod.3: SYNOPSIS: Use 'restrict' in prototypes

Alejandro Colomar alx.manpages@gmail.com
Wed Mar 10 18:31:45 GMT 2021


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



More information about the Libc-alpha mailing list