From 8aa4a92942b7bf1183878ea75e378de02046fdc4 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 12:35:14 +0100 Subject: [PATCH 16/29] careadlinkat: Use 'restrict'. * lib/careadlinkat.h (careadlinkat): Use 'restrict'. * modules/careadlinkat (configure.ac): Require AC_C_RESTRICT. * modules/relocatable-prog-wrapper (configure.ac): Likewise. --- ChangeLog | 5 +++++ lib/careadlinkat.h | 2 +- modules/careadlinkat | 1 + modules/relocatable-prog-wrapper | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7f4db6a..fc7190c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2020-02-23 Bruno Haible + careadlinkat: Use 'restrict'. + * lib/careadlinkat.h (careadlinkat): Use 'restrict'. + * modules/careadlinkat (configure.ac): Require AC_C_RESTRICT. + * modules/relocatable-prog-wrapper (configure.ac): Likewise. + regex-quote: Use 'restrict'. * lib/regex-quote.h (regex_quote_copy): Use 'restrict'. * modules/regex-quote (configure.ac): Require AC_C_RESTRICT. diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h index 584cfe9..a4a37b2 100644 --- a/lib/careadlinkat.h +++ b/lib/careadlinkat.h @@ -47,7 +47,7 @@ struct allocator; set errno. */ char *careadlinkat (int fd, char const *filename, - char *buffer, size_t buffer_size, + char *restrict buffer, size_t buffer_size, struct allocator const *alloc, ssize_t (*preadlinkat) (int, char const *, char *, size_t)); diff --git a/modules/careadlinkat b/modules/careadlinkat index 9dd7471..3f49aae 100644 --- a/modules/careadlinkat +++ b/modules/careadlinkat @@ -11,6 +11,7 @@ ssize_t unistd configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) AC_CHECK_FUNCS_ONCE([readlinkat]) Makefile.am: diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper index d70d63e..58af208 100644 --- a/modules/relocatable-prog-wrapper +++ b/modules/relocatable-prog-wrapper @@ -49,6 +49,7 @@ verify xalloc-oversized configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) gl_FUNC_READLINK_SEPARATE gl_CANONICALIZE_LGPL_SEPARATE gl_MALLOCA -- 2.7.4