diff mbox series

[1/2] ctime.3: Use VLA notation for [as]ctime_r() buffer

Message ID 20211020202241.171180-1-alx.manpages@gmail.com
State Not Applicable
Headers show
Series [1/2] ctime.3: Use VLA notation for [as]ctime_r() buffer | expand

Checks

Context Check Description
dj/TryBot-apply_patch fail Patch failed to apply to master at the time it was sent

Commit Message

Alejandro Colomar \(man-pages\) Oct. 20, 2021, 8:22 p.m. UTC
As N2417 (part of C2x) suggests.  This syntax is very informative,
and also, if used by library implementers, can improve static analysis.

Since it is backwards compatible with pointer syntax, we can do this.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Jens Gustedt <jens.gustedt@loria.fr>
Cc: Glibc <libc-alpha@sourceware.org>
---
 man3/ctime.3 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/man3/ctime.3 b/man3/ctime.3
index 0e2068a09..0620741e9 100644
--- a/man3/ctime.3
+++ b/man3/ctime.3
@@ -41,10 +41,12 @@  localtime_r \- transform date and time to broken-down time or ASCII
 .B #include <time.h>
 .PP
 .BI "char *asctime(const struct tm *" tm );
-.BI "char *asctime_r(const struct tm *restrict " tm ", char *restrict " buf );
+.BI "char *asctime_r(const struct tm *restrict " tm ,
+.BI "                    char " buf "[static restrict 26]);"
 .PP
 .BI "char *ctime(const time_t *" timep );
-.BI "char *ctime_r(const time_t *restrict " timep ", char *restrict " buf );
+.BI "char *ctime_r(const time_t *restrict " timep ,
+.BI "                    char " buf "[static restrict 26]);"
 .PP
 .BI "struct tm *gmtime(const time_t *" timep );
 .BI "struct tm *gmtime_r(const time_t *restrict " timep ,