>From f2042e039a29fdab365929d776fee22bfeff15fb Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 12:12:09 +0100 Subject: [PATCH 03/29] c-snprintf: Use 'restrict'. * lib/c-snprintf.h (c_snprintf): Use 'restrict'. * modules/c-snprintf (configure.ac): Require AC_C_RESTRICT. --- ChangeLog | 4 ++++ lib/c-snprintf.h | 3 ++- modules/c-snprintf | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 80a90eb..277b594 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + c-snprintf: Use 'restrict'. + * lib/c-snprintf.h (c_snprintf): Use 'restrict'. + * modules/c-snprintf (configure.ac): Require AC_C_RESTRICT. + astrxfrm: Use 'restrict'. * lib/astrxfrm.h (astrxfrm): Use 'restrict'. * modules/astrxfrm (configure.ac): Require AC_C_RESTRICT. diff --git a/lib/c-snprintf.h b/lib/c-snprintf.h index bfdc081..d82f354 100644 --- a/lib/c-snprintf.h +++ b/lib/c-snprintf.h @@ -36,7 +36,8 @@ extern "C" { #endif -int c_snprintf (char *str, size_t size, const char *format, ...) +extern int c_snprintf (char *restrict str, size_t size, + const char *format, ...) _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4)); #ifdef __cplusplus diff --git a/modules/c-snprintf b/modules/c-snprintf index edebe2b..2449b01 100644 --- a/modules/c-snprintf +++ b/modules/c-snprintf @@ -9,6 +9,7 @@ Depends-on: c-vasnprintf configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) Makefile.am: lib_SOURCES += c-snprintf.c -- 2.7.4