From 23bdd874515b236a32ae2bf4658fd75b148e6efb Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 24 Feb 2021 15:42:53 +0100 Subject: [PATCH] asprintf.3: SYNOPSIS: Use 'restrict' in prototypes 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 Signed-off-by: Michael Kerrisk --- man3/asprintf.3 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/man3/asprintf.3 b/man3/asprintf.3 index b682a7793..d09c2437e 100644 --- a/man3/asprintf.3 +++ b/man3/asprintf.3 @@ -32,8 +32,9 @@ asprintf, vasprintf \- print to allocated string .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .B #include .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