>From fc00c78e289085063c1832a54d73fc784e9f9626 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 12:15:09 +0100 Subject: [PATCH 05/29] c-vasnprintf: Use 'restrict'. * lib/c-vasnprintf.h (c_vasnprintf): Use 'restrict'. * modules/c-vasnprintf (configure.ac): Require AC_C_RESTRICT. --- ChangeLog | 4 ++++ lib/c-vasnprintf.h | 3 ++- modules/c-vasnprintf | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1bc838e..9db6d8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + c-vasnprintf: Use 'restrict'. + * lib/c-vasnprintf.h (c_vasnprintf): Use 'restrict'. + * modules/c-vasnprintf (configure.ac): Require AC_C_RESTRICT. + c-vsnprintf: Use 'restrict'. * lib/c-vsnprintf.h (c_vsnprintf): Use 'restrict'. * modules/c-vsnprintf (configure.ac): Require AC_C_RESTRICT. diff --git a/lib/c-vasnprintf.h b/lib/c-vasnprintf.h index 1a69e56..0f58fb8 100644 --- a/lib/c-vasnprintf.h +++ b/lib/c-vasnprintf.h @@ -66,7 +66,8 @@ extern "C" { Formatting takes place in the C locale, that is, the decimal point used in floating-point formatting directives is always '.'. */ -extern char *c_vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) +extern char *c_vasnprintf (char *restrict resultbuf, size_t *lengthp, + const char *format, va_list args) _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0)); #ifdef __cplusplus diff --git a/modules/c-vasnprintf b/modules/c-vasnprintf index ae51ea9..391d964 100644 --- a/modules/c-vasnprintf +++ b/modules/c-vasnprintf @@ -39,6 +39,7 @@ multiarch verify configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) gl_PREREQ_VASNPRINTF_WITH_EXTRAS Makefile.am: -- 2.7.4