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@xxxxxxxxxxxxxx> Cc: Ulrich Drepper <drepper@xxxxxxxxxx> Signed-off-by: Alejandro Colomar <alx.manpages@xxxxxxxxx> --- man3/ctime.3 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/man3/ctime.3 b/man3/ctime.3 index cd0ccc98d..7e4baa390 100644 --- a/man3/ctime.3 +++ b/man3/ctime.3 @@ -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 (), -- 2.30.1.721.g45526154a5