[07/20] ctime.3: SYNOPSIS: Use 'restrict' in prototypes
Commit Message
POSIX does NOT specify ctime_r() to use 'restrict'.
However, glibc uses 'restrict'.
Users might be surprised by this! Let's use it here too!
......
.../glibc$ grep_glibc_prototype ctime_r
timezone/private.h:504:
char *ctime_r(time_t const *, char *);
timezone/private.h:712:
char *ctime_r(time_t const *, char *);
time/time.h:153:
extern char *ctime_r (const time_t *__restrict __timer,
char *__restrict __buf) __THROW;
.../glibc$
Cc: <libc-alpha@sourceware.org>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
man3/ctime.3 | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
@@ -44,7 +44,7 @@ localtime_r \- transform date and time to broken-down time or ASCII
.BI "char *asctime_r(const struct tm *restrict " tm ", char *restrict " buf );
.PP
.BI "char *ctime(const time_t *" timep );
-.BI "char *ctime_r(const time_t *" timep ", char *" buf );
+.BI "char *ctime_r(const time_t *restrict " timep ", char *restrict " buf );
.PP
.BI "struct tm *gmtime(const time_t *" timep );
.BI "struct tm *gmtime_r(const time_t *restrict " timep ,
@@ -381,6 +381,12 @@ as obsolete,
recommending the use of
.BR strftime (3)
instead.
+.PP
+POSIX doesn't specify the parameters of
+.BR ctime_r ()
+to be
+.IR restrict ;
+that is specific to glibc.
.SH NOTES
The four functions
.BR asctime (),