>From 0423ac9fe82acd56e3b4108738cb3426c6216d6e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 12:33:37 +0100 Subject: [PATCH 15/29] regex-quote: Use 'restrict'. * lib/regex-quote.h (regex_quote_copy): Use 'restrict'. * modules/regex-quote (configure.ac): Require AC_C_RESTRICT. --- ChangeLog | 4 ++++ lib/regex-quote.h | 2 +- modules/regex-quote | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 525ecdb..7f4db6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + regex-quote: Use 'restrict'. + * lib/regex-quote.h (regex_quote_copy): Use 'restrict'. + * modules/regex-quote (configure.ac): Require AC_C_RESTRICT. + system-quote: Use 'restrict'. * lib/system-quote.h (system_quote_copy): Use 'restrict'. * modules/system-quote (configure.ac): Require AC_C_RESTRICT. diff --git a/lib/regex-quote.h b/lib/regex-quote.h index 185f9fe..b6b299f 100644 --- a/lib/regex-quote.h +++ b/lib/regex-quote.h @@ -77,7 +77,7 @@ extern size_t /* Copies the quoted string to p and returns the incremented p. There must be room for regex_quote_length (string, spec) + 1 bytes at p. */ extern char * - regex_quote_copy (char *p, + regex_quote_copy (char *restrict p, const char *string, const struct regex_quote_spec *spec); /* Returns the freshly allocated quoted string. */ diff --git a/modules/regex-quote b/modules/regex-quote index 9b67ca2..4623339 100644 --- a/modules/regex-quote +++ b/modules/regex-quote @@ -11,6 +11,7 @@ xalloc mbuiter configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) Makefile.am: lib_SOURCES += regex-quote.c -- 2.7.4