]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
asprintf.3: SYNOPSIS: Use 'restrict' in prototypes
authorAlejandro Colomar <alx.manpages@gmail.com>
Wed, 24 Feb 2021 14:42:53 +0000 (15:42 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 3 Mar 2021 22:12:22 +0000 (23:12 +0100)
Glibc uses 'restrict' for [v]asprintf().
Let's use it here too.

......

.../glibc$ grep_glibc_prototype asprintf
libio/stdio.h:372:
extern int asprintf (char **__restrict __ptr,
     const char *__restrict __fmt, ...)
     __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
.../glibc$ grep_glibc_prototype vasprintf
libio/stdio.h:366:
extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
      __gnuc_va_list __arg)
     __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/asprintf.3

index b682a7793aad83888e02c8f923add258bdeda2ef..d09c2437e355e662d759bcba0c75ee8fa240647b 100644 (file)
@@ -32,8 +32,9 @@ asprintf, vasprintf \- print to allocated string
 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
 .B #include <stdio.h>
 .PP
-.BI "int asprintf(char **" strp ", const char *" fmt ", ...);"
-.BI "int vasprintf(char **" strp ", const char *" fmt ", va_list " ap );
+.BI "int asprintf(char **restrict " strp ", const char *restrict " fmt ", ...);"
+.BI "int vasprintf(char **restrict " strp ", const char *restrict " fmt ,
+.BI "              va_list " ap );
 .fi
 .SH DESCRIPTION
 The functions