]> Savannah Git Hosting - gnulib.git/commitdiff
c-snprintf: Use 'restrict'.
authorBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 11:12:09 +0000 (12:12 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 11:12:09 +0000 (12:12 +0100)
* lib/c-snprintf.h (c_snprintf): Use 'restrict'.
* modules/c-snprintf (configure.ac): Require AC_C_RESTRICT.

ChangeLog
lib/c-snprintf.h
modules/c-snprintf

index 80a90eb6b532e3b5f64e1fe730fbb00c13badc78..277b594a9ea8681c77a775924dcfc3ac0c30f100 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2020-02-23  Bruno Haible  <bruno@clisp.org>
 
+       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.
index bfdc081d683ba1064c2ba29c2004d5dc31143468..d82f35408b962794fa9effa28d4ceedc119dadf7 100644 (file)
@@ -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
index edebe2bc04ee4e830dfae4c8a4295856840371ff..2449b0119551d6228de22b8f7a412bc641b7d8a6 100644 (file)
@@ -9,6 +9,7 @@ Depends-on:
 c-vasnprintf
 
 configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
 
 Makefile.am:
 lib_SOURCES += c-snprintf.c