>From 69acbf9b8d4b8517eefa25be74e436f22b9b0428 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 12:13:40 +0100 Subject: [PATCH 04/29] c-vsnprintf: Use 'restrict'. * lib/c-vsnprintf.h (c_vsnprintf): Use 'restrict'. * modules/c-vsnprintf (configure.ac): Require AC_C_RESTRICT. --- ChangeLog | 4 ++++ lib/c-vsnprintf.h | 3 ++- modules/c-vsnprintf | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 277b594..1bc838e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + c-vsnprintf: Use 'restrict'. + * lib/c-vsnprintf.h (c_vsnprintf): Use 'restrict'. + * modules/c-vsnprintf (configure.ac): Require AC_C_RESTRICT. + c-snprintf: Use 'restrict'. * lib/c-snprintf.h (c_snprintf): Use 'restrict'. * modules/c-snprintf (configure.ac): Require AC_C_RESTRICT. diff --git a/lib/c-vsnprintf.h b/lib/c-vsnprintf.h index 97a2816..e296871 100644 --- a/lib/c-vsnprintf.h +++ b/lib/c-vsnprintf.h @@ -39,7 +39,8 @@ extern "C" { #endif -int c_vsnprintf (char *str, size_t size, const char *format, va_list args) +extern int c_vsnprintf (char *restrict str, size_t size, + const char *format, va_list args) _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0)); #ifdef __cplusplus diff --git a/modules/c-vsnprintf b/modules/c-vsnprintf index 7846d9d..b227e92 100644 --- a/modules/c-vsnprintf +++ b/modules/c-vsnprintf @@ -10,6 +10,7 @@ Depends-on: c-vasnprintf configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) Makefile.am: lib_SOURCES += c-vsnprintf.c -- 2.7.4