From: Bruno Haible Date: Sun, 23 Feb 2020 11:31:00 +0000 (+0100) Subject: sh-quote: Use 'restrict'. X-Git-Tag: v1.0~4217 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=a85a39de0293d492a6a087c356f4e3a26e0d1cee;p=gnulib.git sh-quote: Use 'restrict'. * lib/sh-quote.h (shell_quote_copy): Use 'restrict'. * modules/sh-quote (configure.ac): Require AC_C_RESTRICT. --- diff --git a/ChangeLog b/ChangeLog index 8b87c6bc65..a00c415c6e 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 9dcd4cfe41..8b06355835 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 83fa08905c..97378f8bb5 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