>From a85a39de0293d492a6a087c356f4e3a26e0d1cee Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 12:31:00 +0100 Subject: [PATCH 13/29] sh-quote: Use 'restrict'. * lib/sh-quote.h (shell_quote_copy): Use 'restrict'. * modules/sh-quote (configure.ac): Require AC_C_RESTRICT. --- ChangeLog | 4 ++++ lib/sh-quote.h | 2 +- modules/sh-quote | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8b87c6b..a00c415 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + sh-quote: Use 'restrict'. + * lib/sh-quote.h (shell_quote_copy): Use 'restrict'. + * modules/sh-quote (configure.ac): Require AC_C_RESTRICT. + quotearg: Use 'restrict'. * lib/quotearg.h (quotearg_buffer): Use 'restrict'. * m4/quotearg.m4 (gl_QUOTEARG): Require AC_C_RESTRICT. diff --git a/lib/sh-quote.h b/lib/sh-quote.h index 9dcd4cf..8b06355 100644 --- a/lib/sh-quote.h +++ b/lib/sh-quote.h @@ -33,7 +33,7 @@ extern size_t shell_quote_length (const char *string); /* Copies the quoted string to p and returns the incremented p. There must be room for shell_quote_length (string) + 1 bytes at p. */ -extern char * shell_quote_copy (char *p, const char *string); +extern char * shell_quote_copy (char *restrict p, const char *string); /* Returns the freshly allocated quoted string. */ extern char * shell_quote (const char *string); diff --git a/modules/sh-quote b/modules/sh-quote index 83fa089..97378f8 100644 --- a/modules/sh-quote +++ b/modules/sh-quote @@ -10,6 +10,7 @@ quotearg xalloc configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) Makefile.am: lib_SOURCES += sh-quote.h sh-quote.c -- 2.7.4