On 2/10/20 4:02 AM, Bruno Haible wrote: > Tim Rühsen wrote: >> gcc -Wall tells you so (gcc 8 and upwards): >> $ gcc -Wall msg.c -o msg >> msg.c: In function ‘main’: >> msg.c:11:13: warning: passing argument 1 to restrict-qualified parameter >> aliases with argument 4 [-Wrestrict] >> 11 | snprintf (msg, sizeof (msg), "%s%s", msg, WRONG_MESSAGE); >> | ^~~ ~~~ >> msg.c:11:35: warning: ‘%s’ directive output may be truncated writing 4 >> bytes into a region of size between 1 and 11 [-Wformat-truncation=] >> 11 | snprintf (msg, sizeof (msg), "%s%s", msg, WRONG_MESSAGE); >> | ^~ >> msg.c:11:3: note: ‘snprintf’ output between 5 and 15 bytes into a >> destination of size 11 >> 11 | snprintf (msg, sizeof (msg), "%s%s", msg, WRONG_MESSAGE); >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> > > Oh, the 'restrict' keyword is actually useful (other than for micro- > optimizations)! Thanks for this pointer, Tim. > > So, it would make sense to use this keyword in function declarations in > public .h files in gnulib. > > For internal .h files in gnulib, there's no point - this code is assumed > correct, no need to try to get GCC to produce warnings here. > > What does 'restrict' precisely mean? ISO C 99 § 6.7.3.(7): > "An object that is accessed through a restrict-qualified pointer has a > special association with that pointer. This association, defined in > 6.7.3.1 below, requires that all accesses to that object use, directly > or indirectly, the value of that particular pointer.115) The intended > use of the restrict qualifier (like the register storage class) is to > promote optimization, and deleting all instances of the qualifier from > all preprocessing translation units composing a conforming program > does not change its meaning (i.e., observable behavior)." > > Which function declarations could therefore profit from the 'restrict' > keyword? > > - Only parameters of pointer types, excluding function pointer types, > matter. > > - If all pointer parameters are 'const SOMETHING *', the function > is not writing into them, therefore 'restrict' is redundant. > Example: int strcmp (const char *, const char *); > > - If all pointer parameters point to different types, excluding 'void *', > ISO C forbids aliasing anyway, therefore 'restrict' is redundant. > Example: void dfacomp (char const *, ptrdiff_t, struct dfa *, bool); > and https://pubs.opengroup.org/onlinepubs/9699919799/functions/glob.html > > - If, among the parameters, there are N parameters of type > [const] TYPE * > adding the 'restrict' keyword to N-1 of them is equivalent to adding > the 'restrict' keyword to all N of them. > See ISO C 99 § 6.7.3.1.(7) [Example 1]. > > GCC's warning facility understands this, regarding the non-const pointer. > Test case: > ======================================================================== > #include > extern int smprintf (char *restrict, size_t, const char *, ...) > __attribute__ ((__format__ (__printf__, 3, 4))); > int main () > { > char msg[sizeof ("try a fool")] = "try a "; > smprintf (msg, sizeof (msg), "%s%s", msg, "fool"); > } > ======================================================================== > > - If a function has an input parameter of type > const TYPE * > and an output parameter of type > TYPE * > then the 'restrict' keyword means that the implementation may write > the output before having finished reading all the input. > Example: > void arctwo_encrypt (arctwo_context *context, const char *inbuf, > char * restrict outbuf, size_t length); Doesn't this need 'restrict' for the 'inbuf' parameter as well ? If not, why is glibc applying restrict to both parameters of strcpy ? > Whereas the absence of the 'restrict' keyword means that the > implementation will read all the input _before_ starting to store > the output. Can we say "Whereas the absence of the 'restrict' keyword means that the implementation guarantees documented operation for any aliasing of input and output" ? > Example: > int hmac_md5 (const void *key, size_t keylen, > const void *buffer, size_t buflen, void *resbuf); > > - 'restrict' should NOT be used for multiple output parameters of the > same type, when only a single word is written through each parameter. > Example: ssize_t copy_file_range (int ifd, off_t *ipos, int ofd, off_t *opos, > size_t len, unsigned flags); > Rationale: It is OK to have ipos and opos point to different elements > of the same off_t[] array. > > Is this all right, or did I misinterpret something? IMO, a very good interpretation and summary ! I can't add anything except the above questions. > If it is right, then how about this start of a patch? (Not sure whether I need > to add the 'restrict' keyword also in the function definitions?) AFAIK, 'restrict' in declarations should be enough, except you just have a definition (e.g. static functions). Function pointer typedefs also need the restrict keywords (but the compiler should warn about it in case you forget *and* not use casts). Regards, Tim > > Bruno > > > diff --git a/lib/amemxfrm.h b/lib/amemxfrm.h > index 7cfc283..0edd3d5 100644 > --- a/lib/amemxfrm.h > +++ b/lib/amemxfrm.h > @@ -38,7 +38,8 @@ extern "C" { > freshly allocated string is returned. In both cases, *lengthp is set to the > length of the returned string. > Upon failure, return NULL, with errno set. */ > -extern char * amemxfrm (char *s, size_t n, char *resultbuf, size_t *lengthp); > +extern char * amemxfrm (char * restrict s, size_t n, > + char * restrict resultbuf, size_t *lengthp); > > > #ifdef __cplusplus > diff --git a/lib/arcfour.h b/lib/arcfour.h > index b77df1a..b23e792 100644 > --- a/lib/arcfour.h > +++ b/lib/arcfour.h > @@ -37,7 +37,7 @@ typedef struct > before this function is called. */ > extern void > arcfour_stream (arcfour_context * context, > - const char *inbuf, char *outbuf, size_t length); > + const char *inbuf, char * restrict outbuf, size_t length); > > /* Initialize CONTEXT using encryption KEY of KEYLEN bytes. KEY > should be 40 bits (5 bytes) or longer. The KEY cannot be zero > diff --git a/lib/arctwo.h b/lib/arctwo.h > index 91f725f..e88489a 100644 > --- a/lib/arctwo.h > +++ b/lib/arctwo.h > @@ -48,7 +48,7 @@ arctwo_setkey_ekb (arctwo_context *context, > arctwo_setkey_ekb. */ > extern void > arctwo_encrypt (arctwo_context *context, const char *inbuf, > - char *outbuf, size_t length); > + char * restrict outbuf, size_t length); > > /* Decrypt INBUF of size LENGTH into OUTBUF. LENGTH must be a > multiple of ARCTWO_BLOCK_SIZE. CONTEXT hold the decryption key, > @@ -56,6 +56,6 @@ arctwo_encrypt (arctwo_context *context, const char *inbuf, > arctwo_setkey_ekb. */ > extern void > arctwo_decrypt (arctwo_context *context, const char *inbuf, > - char *outbuf, size_t length); > + char * restrict outbuf, size_t length); > > #endif /* ARCTWO_H */ > diff --git a/lib/astrxfrm.h b/lib/astrxfrm.h > index a23ed70..9906659 100644 > --- a/lib/astrxfrm.h > +++ b/lib/astrxfrm.h > @@ -37,7 +37,8 @@ extern "C" { > freshly allocated string is returned. In both cases, *lengthp is set to the > length of the returned string. > Upon failure, return NULL, with errno set. */ > -extern char * astrxfrm (const char *s, char *resultbuf, size_t *lengthp); > +extern char * astrxfrm (const char *s, > + char * restrict resultbuf, size_t *lengthp); > > > #ifdef __cplusplus > diff --git a/lib/c-snprintf.h b/lib/c-snprintf.h > index bfdc081..3b31bd4 100644 > --- a/lib/c-snprintf.h > +++ b/lib/c-snprintf.h > @@ -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 > diff --git a/lib/c-vasnprintf.h b/lib/c-vasnprintf.h > index 1a69e56..c44a31b 100644 > --- a/lib/c-vasnprintf.h > +++ b/lib/c-vasnprintf.h > @@ -66,7 +66,8 @@ extern "C" { > Formatting takes place in the C locale, that is, the decimal point used in > floating-point formatting directives is always '.'. > */ > -extern char *c_vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) > +extern char *c_vasnprintf (char * restrict resultbuf, size_t *lengthp, > + const char *format, va_list args) > _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0)); > > #ifdef __cplusplus > diff --git a/lib/c-vsnprintf.h b/lib/c-vsnprintf.h > index 97a2816..1b20fd5 100644 > --- a/lib/c-vsnprintf.h > +++ b/lib/c-vsnprintf.h > @@ -39,7 +39,8 @@ > extern "C" { > #endif > > -int c_vsnprintf (char *str, size_t size, const char *format, va_list args) > +extern int c_vsnprintf (char * restrict str, size_t size, > + const char *format, va_list args) > _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0)); > > #ifdef __cplusplus > diff --git a/lib/careadlinkat.h b/lib/careadlinkat.h > index 584cfe9..f249ab6 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/lib/gc.h b/lib/gc.h > index 05fb8a3..bd90bd0 100644 > --- a/lib/gc.h > +++ b/lib/gc.h > @@ -185,12 +185,12 @@ extern Gc_rc > gc_pbkdf2_hmac (Gc_hash hash, > const char *P, size_t Plen, > const char *S, size_t Slen, > - unsigned int c, char *DK, size_t dkLen); > + unsigned int c, char * restrict DK, size_t dkLen); > > extern Gc_rc > gc_pbkdf2_sha1 (const char *P, size_t Plen, > const char *S, size_t Slen, > - unsigned int c, char *DK, size_t dkLen); > + unsigned int c, char * restrict DK, size_t dkLen); > > /* > TODO: > diff --git a/lib/gl_openssl.h b/lib/gl_openssl.h > index e5991d8..d188a6a 100644 > --- a/lib/gl_openssl.h > +++ b/lib/gl_openssl.h > @@ -90,15 +90,15 @@ GL_CRYPTO_FN (_process_block) (const void *buf, size_t len, struct _gl_ctx *ctx) > #endif > > GL_OPENSSL_INLINE void * > -GL_CRYPTO_FN (_finish_ctx) (struct _gl_ctx *ctx, void *res) > +GL_CRYPTO_FN (_finish_ctx) (struct _gl_ctx *ctx, void * restrict res) > { OPENSSL_FN (_Final) ((unsigned char *) res, (_gl_CTX *) ctx); return res; } > > GL_OPENSSL_INLINE void * > -GL_CRYPTO_FN (_buffer) (const char *buf, size_t len, void *res) > +GL_CRYPTO_FN (_buffer) (const char *buf, size_t len, void * restrict res) > { return OPENSSL_FN () ((const unsigned char *) buf, len, (unsigned char *) res); } > > GL_OPENSSL_INLINE void * > -GL_CRYPTO_FN (_read_ctx) (const struct _gl_ctx *ctx, void *res) > +GL_CRYPTO_FN (_read_ctx) (const struct _gl_ctx *ctx, void * restrict res) > { > /* Assume any unprocessed bytes in ctx are not to be ignored. */ > _gl_CTX tmp_ctx = *(_gl_CTX *) ctx; > diff --git a/lib/memcoll.h b/lib/memcoll.h > index add0968..233385b 100644 > --- a/lib/memcoll.h > +++ b/lib/memcoll.h > @@ -22,7 +22,7 @@ > > # include > > -int memcoll (char *, size_t, char *, size_t); > +int memcoll (char * restrict, size_t, char * restrict, size_t); > int memcoll0 (char const *, size_t, char const *, size_t); > > #endif /* MEMCOLL_H_ */ > diff --git a/lib/monetary.in.h b/lib/monetary.in.h > index ab17917..5b67cec 100644 > --- a/lib/monetary.in.h > +++ b/lib/monetary.in.h > @@ -79,15 +79,18 @@ extern "C" { > # if !(defined __cplusplus && defined GNULIB_NAMESPACE) > # define strfmon_l rpl_strfmon_l > # endif > -_GL_FUNCDECL_RPL (strfmon_l, ssize_t, (char *s, size_t maxsize, locale_t locale, > +_GL_FUNCDECL_RPL (strfmon_l, ssize_t, (char * restrict s, size_t maxsize, > + locale_t locale, > const char *format, ...) > _GL_ATTRIBUTE_FORMAT_STRFMON (4, 5) > _GL_ARG_NONNULL ((4))); > -_GL_CXXALIAS_RPL (strfmon_l, ssize_t, (char *s, size_t maxsize, locale_t locale, > +_GL_CXXALIAS_RPL (strfmon_l, ssize_t, (char * restrict s, size_t maxsize, > + locale_t locale, > const char *format, ...)); > # else > # if @HAVE_STRFMON_L@ > -_GL_CXXALIAS_SYS (strfmon_l, ssize_t, (char *s, size_t maxsize, locale_t locale, > +_GL_CXXALIAS_SYS (strfmon_l, ssize_t, (char * restrict s, size_t maxsize, > + locale_t locale, > const char *format, ...)); > # endif > # endif > diff --git a/lib/parse-datetime.h b/lib/parse-datetime.h > index ab9b576..d2c7518 100644 > --- a/lib/parse-datetime.h > +++ b/lib/parse-datetime.h > @@ -19,11 +19,13 @@ > #include > #include > > -bool parse_datetime (struct timespec *, char const *, struct timespec const *); > +bool parse_datetime (struct timespec * restrict, > + char const *, struct timespec const *); > > /* parse_datetime2 flag: if set, print debug/progress information to STDERR */ > #define PARSE_DATETIME_DEBUG 1 > > /* same as above, supporting additional flags */ > -bool parse_datetime2 (struct timespec *, char const *, struct timespec const *, > +bool parse_datetime2 (struct timespec * restrict, > + char const *, struct timespec const *, > unsigned int flags, timezone_t, char const *); > diff --git a/lib/quotearg.h b/lib/quotearg.h > index d30fdd1..1261c8f 100644 > --- a/lib/quotearg.h > +++ b/lib/quotearg.h > @@ -323,7 +323,7 @@ void set_custom_quoting (struct quoting_options *o, > On output, BUFFER might contain embedded null bytes if ARGSIZE was > not -1, the style of O does not use backslash escapes, and the > flags of O do not request elision of null bytes.*/ > -size_t quotearg_buffer (char *buffer, size_t buffersize, > +size_t quotearg_buffer (char * restrict buffer, size_t buffersize, > char const *arg, size_t argsize, > struct quoting_options const *o); > > diff --git a/lib/regex-quote.h b/lib/regex-quote.h > index 185f9fe..0d166c7 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/lib/rijndael-api-fst.h b/lib/rijndael-api-fst.h > index 0553acc..e6ac5ab 100644 > --- a/lib/rijndael-api-fst.h > +++ b/lib/rijndael-api-fst.h > @@ -157,7 +157,7 @@ extern int > rijndaelBlockEncrypt (rijndaelCipherInstance *cipher, > const rijndaelKeyInstance *key, > const char *input, size_t inputLen, > - char *outBuffer); > + char * restrict outBuffer); > > /* Encrypt data in INPUT, of INPUTOCTETS bytes length, placing the > output in the pre-allocated OUTBUFFER which must hold at least > @@ -172,7 +172,7 @@ extern int > rijndaelPadEncrypt (rijndaelCipherInstance *cipher, > const rijndaelKeyInstance *key, > const char *input, size_t inputOctets, > - char *outBuffer); > + char * restrict outBuffer); > > /* Decrypt data in INPUT, of INPUTLEN/8 bytes length, placing the > output in the pre-allocated OUTBUFFER which must hold at least > @@ -185,7 +185,7 @@ extern int > rijndaelBlockDecrypt (rijndaelCipherInstance *cipher, > const rijndaelKeyInstance *key, > const char *input, size_t inputLen, > - char *outBuffer); > + char * restrict outBuffer); > > /* Decrypt data in INPUT, of INPUTOCTETS bytes length, placing the > output in the pre-allocated OUTBUFFER which must hold at least > @@ -200,6 +200,6 @@ extern int > rijndaelPadDecrypt (rijndaelCipherInstance *cipher, > const rijndaelKeyInstance *key, > const char *input, size_t inputOctets, > - char *outBuffer); > + char * restrict outBuffer); > > #endif /* __RIJNDAEL_API_FST_H */ > diff --git a/lib/sh-quote.h b/lib/sh-quote.h > index 9dcd4cf..2f9a69b 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/lib/sha1.h b/lib/sha1.h > index 99c53da..e97914b 100644 > --- a/lib/sha1.h > +++ b/lib/sha1.h > @@ -71,13 +71,13 @@ extern void sha1_process_bytes (const void *buffer, size_t len, > in first 20 bytes following RESBUF. The result is always in little > endian byte order, so that a byte-wise output yields to the wanted > ASCII representation of the message digest. */ > -extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf); > +extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void * restrict resbuf); > > > /* Put result from CTX in first 20 bytes following RESBUF. The result is > always in little endian byte order, so that a byte-wise output yields > to the wanted ASCII representation of the message digest. */ > -extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf); > +extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void * restrict resbuf); > > > /* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The > diff --git a/lib/sha256.h b/lib/sha256.h > index 1bc61d4..a1dad2e 100644 > --- a/lib/sha256.h > +++ b/lib/sha256.h > @@ -70,15 +70,17 @@ extern void sha256_process_bytes (const void *buffer, size_t len, > in first 32 (28) bytes following RESBUF. The result is always in little > endian byte order, so that a byte-wise output yields to the wanted > ASCII representation of the message digest. */ > -extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf); > -extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf); > +extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void * restrict resbuf); > +extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void * restrict resbuf); > > > /* Put result from CTX in first 32 (28) bytes following RESBUF. The result is > always in little endian byte order, so that a byte-wise output yields > to the wanted ASCII representation of the message digest. */ > -extern void *sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf); > -extern void *sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf); > +extern void *sha256_read_ctx (const struct sha256_ctx *ctx, > + void * restrict resbuf); > +extern void *sha224_read_ctx (const struct sha256_ctx *ctx, > + void * restrict resbuf); > > > /* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER. The > diff --git a/lib/sha512.h b/lib/sha512.h > index aaf35a5..20818e0 100644 > --- a/lib/sha512.h > +++ b/lib/sha512.h > @@ -70,8 +70,8 @@ extern void sha512_process_bytes (const void *buffer, size_t len, > in first 64 (48) bytes following RESBUF. The result is always in little > endian byte order, so that a byte-wise output yields to the wanted > ASCII representation of the message digest. */ > -extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf); > -extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf); > +extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void * restrict resbuf); > +extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void * restrict resbuf); > > > /* Put result from CTX in first 64 (48) bytes following RESBUF. The result is > @@ -80,8 +80,10 @@ extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf); > > IMPORTANT: On some systems it is required that RESBUF is correctly > aligned for a 32 bits value. */ > -extern void *sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf); > -extern void *sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf); > +extern void *sha512_read_ctx (const struct sha512_ctx *ctx, > + void * restrict resbuf); > +extern void *sha384_read_ctx (const struct sha512_ctx *ctx, > + void * restrict resbuf); > > > /* Compute SHA512 (SHA384) message digest for LEN bytes beginning at BUFFER. The > diff --git a/lib/signal.in.h b/lib/signal.in.h > index 9fe9f60..9690953 100644 > --- a/lib/signal.in.h > +++ b/lib/signal.in.h > @@ -133,16 +133,20 @@ typedef void (*sighandler_t) (int); > # define pthread_sigmask rpl_pthread_sigmask > # endif > _GL_FUNCDECL_RPL (pthread_sigmask, int, > - (int how, const sigset_t *new_mask, sigset_t *old_mask)); > + (int how, const sigset_t *new_mask, > + sigset_t * restrict old_mask)); > _GL_CXXALIAS_RPL (pthread_sigmask, int, > - (int how, const sigset_t *new_mask, sigset_t *old_mask)); > + (int how, const sigset_t *new_mask, > + sigset_t * restrict old_mask)); > # else > # if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask) > _GL_FUNCDECL_SYS (pthread_sigmask, int, > - (int how, const sigset_t *new_mask, sigset_t *old_mask)); > + (int how, const sigset_t *new_mask, > + sigset_t * restrict old_mask)); > # endif > _GL_CXXALIAS_SYS (pthread_sigmask, int, > - (int how, const sigset_t *new_mask, sigset_t *old_mask)); > + (int how, const sigset_t *new_mask, > + sigset_t * restrict old_mask)); > # endif > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (pthread_sigmask); > @@ -295,10 +299,12 @@ _GL_CXXALIASWARN (sigpending); > # define SIG_SETMASK 1 /* blocked_set = *set; */ > # define SIG_UNBLOCK 2 /* blocked_set = blocked_set & ~*set; */ > _GL_FUNCDECL_SYS (sigprocmask, int, > - (int operation, const sigset_t *set, sigset_t *old_set)); > + (int operation, const sigset_t *set, > + sigset_t * restrict old_set)); > # endif > _GL_CXXALIAS_SYS (sigprocmask, int, > - (int operation, const sigset_t *set, sigset_t *old_set)); > + (int operation, const sigset_t *set, > + sigset_t * restrict old_set)); > _GL_CXXALIASWARN (sigprocmask); > > /* Install the handler FUNC for signal SIG, and return the previous > diff --git a/lib/sm3.h b/lib/sm3.h > index e0bdd90..9da0ab3 100644 > --- a/lib/sm3.h > +++ b/lib/sm3.h > @@ -75,12 +75,12 @@ extern void sm3_process_bytes (const void *buffer, size_t len, > in first 32 bytes following RESBUF. The result is always in little > endian byte order, so that a byte-wise output yields to the wanted > ASCII representation of the message digest. */ > -extern void *sm3_finish_ctx (struct sm3_ctx *ctx, void *resbuf); > +extern void *sm3_finish_ctx (struct sm3_ctx *ctx, void * restrict resbuf); > > /* Put result from CTX in first 32 bytes following RESBUF. The result is > always in little endian byte order, so that a byte-wise output yields > to the wanted ASCII representation of the message digest. */ > -extern void *sm3_read_ctx (const struct sm3_ctx *ctx, void *resbuf); > +extern void *sm3_read_ctx (const struct sm3_ctx *ctx, void * restrict resbuf); > > /* Compute SM3 message digest for LEN bytes beginning at BUFFER. The > result is always in little endian byte order, so that a byte-wise > diff --git a/lib/stdio.in.h b/lib/stdio.in.h > index 388565d..2386852 100644 > --- a/lib/stdio.in.h > +++ b/lib/stdio.in.h > @@ -1113,20 +1113,20 @@ _GL_CXXALIASWARN (scanf); > # define snprintf rpl_snprintf > # endif > _GL_FUNCDECL_RPL (snprintf, int, > - (char *str, size_t size, const char *format, ...) > + (char * restrict str, size_t size, const char *format, ...) > _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4) > _GL_ARG_NONNULL ((3))); > _GL_CXXALIAS_RPL (snprintf, int, > - (char *str, size_t size, const char *format, ...)); > + (char * restrict str, size_t size, const char *format, ...)); > # else > # if !@HAVE_DECL_SNPRINTF@ > _GL_FUNCDECL_SYS (snprintf, int, > - (char *str, size_t size, const char *format, ...) > + (char * restrict str, size_t size, const char *format, ...) > _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4) > _GL_ARG_NONNULL ((3))); > # endif > _GL_CXXALIAS_SYS (snprintf, int, > - (char *str, size_t size, const char *format, ...)); > + (char * restrict str, size_t size, const char *format, ...)); > # endif > _GL_CXXALIASWARN (snprintf); > #elif defined GNULIB_POSIXCHECK > @@ -1151,12 +1151,12 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - " > # if !(defined __cplusplus && defined GNULIB_NAMESPACE) > # define sprintf rpl_sprintf > # endif > -_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...) > +_GL_FUNCDECL_RPL (sprintf, int, (char * restrict str, const char *format, ...) > _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) > _GL_ARG_NONNULL ((1, 2))); > -_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...)); > +_GL_CXXALIAS_RPL (sprintf, int, (char * restrict str, const char *format, ...)); > # else > -_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...)); > +_GL_CXXALIAS_SYS (sprintf, int, (char * restrict str, const char *format, ...)); > # endif > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (sprintf); > @@ -1386,20 +1386,24 @@ _GL_CXXALIASWARN (vscanf); > # define vsnprintf rpl_vsnprintf > # endif > _GL_FUNCDECL_RPL (vsnprintf, int, > - (char *str, size_t size, const char *format, va_list args) > + (char * restrict str, size_t size, > + const char *format, va_list args) > _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) > _GL_ARG_NONNULL ((3))); > _GL_CXXALIAS_RPL (vsnprintf, int, > - (char *str, size_t size, const char *format, va_list args)); > + (char * restrict str, size_t size, > + const char *format, va_list args)); > # else > # if !@HAVE_DECL_VSNPRINTF@ > _GL_FUNCDECL_SYS (vsnprintf, int, > - (char *str, size_t size, const char *format, va_list args) > + (char * restrict str, size_t size, > + const char *format, va_list args) > _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) > _GL_ARG_NONNULL ((3))); > # endif > _GL_CXXALIAS_SYS (vsnprintf, int, > - (char *str, size_t size, const char *format, va_list args)); > + (char * restrict str, size_t size, > + const char *format, va_list args)); > # endif > _GL_CXXALIASWARN (vsnprintf); > #elif defined GNULIB_POSIXCHECK > @@ -1416,17 +1420,17 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - " > # define vsprintf rpl_vsprintf > # endif > _GL_FUNCDECL_RPL (vsprintf, int, > - (char *str, const char *format, va_list args) > + (char * restrict str, const char *format, va_list args) > _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) > _GL_ARG_NONNULL ((1, 2))); > _GL_CXXALIAS_RPL (vsprintf, int, > - (char *str, const char *format, va_list args)); > + (char * restrict str, const char *format, va_list args)); > # else > /* Need to cast, because on Solaris, the third parameter is > __va_list args > and GCC's fixincludes did not change this to __gnuc_va_list. */ > _GL_CXXALIAS_SYS_CAST (vsprintf, int, > - (char *str, const char *format, va_list args)); > + (char * restrict str, const char *format, va_list args)); > # endif > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (vsprintf); > diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h > index 49bbf6f..5ae909d 100644 > --- a/lib/stdlib.in.h > +++ b/lib/stdlib.in.h > @@ -866,15 +866,19 @@ _GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - " > # if !(defined __cplusplus && defined GNULIB_NAMESPACE) > # define realpath rpl_realpath > # endif > -_GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved) > - _GL_ARG_NONNULL ((1))); > -_GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved)); > +_GL_FUNCDECL_RPL (realpath, char *, > + (const char *name, char * restrict resolved) > + _GL_ARG_NONNULL ((1))); > +_GL_CXXALIAS_RPL (realpath, char *, > + (const char *name, char * restrict resolved)); > # else > # if !@HAVE_REALPATH@ > -_GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved) > - _GL_ARG_NONNULL ((1))); > +_GL_FUNCDECL_SYS (realpath, char *, > + (const char *name, char * restrict resolved) > + _GL_ARG_NONNULL ((1))); > # endif > -_GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved)); > +_GL_CXXALIAS_SYS (realpath, char *, > + (const char *name, char * restrict resolved)); > # endif > _GL_CXXALIASWARN (realpath); > #elif defined GNULIB_POSIXCHECK > diff --git a/lib/strftime.h b/lib/strftime.h > index 97a062c..d0ac48e 100644 > --- a/lib/strftime.h > +++ b/lib/strftime.h > @@ -25,7 +25,7 @@ extern "C" { > POSIX requires that strftime use the local timezone information. > Use the timezone __TZ instead. Use __NS as the number of > nanoseconds in the %N directive. */ > -size_t nstrftime (char *, size_t, char const *, struct tm const *, > +size_t nstrftime (char * restrict, size_t, char const *, struct tm const *, > timezone_t __tz, int __ns); > > #ifdef __cplusplus > diff --git a/lib/string.in.h b/lib/string.in.h > index 2be474d..de97453 100644 > --- a/lib/string.in.h > +++ b/lib/string.in.h > @@ -411,11 +411,14 @@ _GL_WARN_ON_USE (strdup, "strdup is unportable - " > # undef strncat > # define strncat rpl_strncat > # endif > -_GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n) > - _GL_ARG_NONNULL ((1, 2))); > -_GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n)); > +_GL_FUNCDECL_RPL (strncat, char *, > + (char * restrict dest, const char *src, size_t n) > + _GL_ARG_NONNULL ((1, 2))); > +_GL_CXXALIAS_RPL (strncat, char *, > + (char * restrict dest, const char *src, size_t n)); > # else > -_GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n)); > +_GL_CXXALIAS_SYS (strncat, char *, > + (char * restrict dest, const char *src, size_t n)); > # endif > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (strncat); > @@ -966,7 +969,8 @@ _GL_EXTERN_C char * mbssep (char **stringp, const char *delim) > Caveat: The identity of the delimiting character is lost. > > See also mbssep(). */ > -_GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr) > +_GL_EXTERN_C char * mbstok_r (char * restrict string, const char *delim, > + char **save_ptr) > _GL_ARG_NONNULL ((2, 3)); > #endif > > diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h > index 8e013e6..2c44801 100644 > --- a/lib/sys_socket.in.h > +++ b/lib/sys_socket.in.h > @@ -462,15 +462,18 @@ _GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - " > # define getsockopt rpl_getsockopt > # endif > _GL_FUNCDECL_RPL (getsockopt, int, (int fd, int level, int optname, > - void *optval, socklen_t *optlen) > + void * restrict optval, > + socklen_t * restrict optlen) > _GL_ARG_NONNULL ((4, 5))); > _GL_CXXALIAS_RPL (getsockopt, int, (int fd, int level, int optname, > - void *optval, socklen_t *optlen)); > + void * restrict optval, > + socklen_t * restrict optlen)); > # else > /* Need to cast, because on Solaris 10 systems, the fifth parameter is > void *optlen. */ > _GL_CXXALIAS_SYS_CAST (getsockopt, int, (int fd, int level, int optname, > - void *optval, socklen_t *optlen)); > + void * restrict optval, > + socklen_t * restrict optlen)); > # endif > _GL_CXXALIASWARN (getsockopt); > #elif @HAVE_WINSOCK2_H@ > @@ -571,17 +574,17 @@ _GL_WARN_ON_USE (send, "send is not always POSIX compliant - " > # define recvfrom rpl_recvfrom > # endif > _GL_FUNCDECL_RPL (recvfrom, ssize_t, > - (int fd, void *buf, size_t len, int flags, > + (int fd, void * restrict buf, size_t len, int flags, > struct sockaddr *from, socklen_t *fromlen) > _GL_ARG_NONNULL ((2))); > _GL_CXXALIAS_RPL (recvfrom, ssize_t, > - (int fd, void *buf, size_t len, int flags, > + (int fd, void * restrict buf, size_t len, int flags, > struct sockaddr *from, socklen_t *fromlen)); > # else > /* Need to cast, because on Solaris 10 systems, the sixth parameter is > void *fromlen. */ > _GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t, > - (int fd, void *buf, size_t len, int flags, > + (int fd, void * restrict buf, size_t len, int flags, > struct sockaddr *from, socklen_t *fromlen)); > # endif > _GL_CXXALIASWARN (recvfrom); > diff --git a/lib/system-quote.h b/lib/system-quote.h > index d31d47f..2f50779 100644 > --- a/lib/system-quote.h > +++ b/lib/system-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 system_quote_length (string) + 1 bytes at p. */ > extern char * > - system_quote_copy (char *p, > + system_quote_copy (char * restrict p, > enum system_command_interpreter interpreter, > const char *string); > > diff --git a/lib/time.in.h b/lib/time.in.h > index 7304668..0edf0b3 100644 > --- a/lib/time.in.h > +++ b/lib/time.in.h > @@ -286,13 +286,13 @@ _GL_CXXALIASWARN (ctime); > # if !(defined __cplusplus && defined GNULIB_NAMESPACE) > # define strftime rpl_strftime > # endif > -_GL_FUNCDECL_RPL (strftime, size_t, (char *__buf, size_t __bufsize, > +_GL_FUNCDECL_RPL (strftime, size_t, (char * restrict __buf, size_t __bufsize, > const char *__fmt, const struct tm *__tp) > _GL_ARG_NONNULL ((1, 3, 4))); > -_GL_CXXALIAS_RPL (strftime, size_t, (char *__buf, size_t __bufsize, > +_GL_CXXALIAS_RPL (strftime, size_t, (char * restrict __buf, size_t __bufsize, > const char *__fmt, const struct tm *__tp)); > # else > -_GL_CXXALIAS_SYS (strftime, size_t, (char *__buf, size_t __bufsize, > +_GL_CXXALIAS_SYS (strftime, size_t, (char * restrict __buf, size_t __bufsize, > const char *__fmt, const struct tm *__tp)); > # endif > # if __GLIBC__ >= 2 > diff --git a/lib/unicase.in.h b/lib/unicase.in.h > index 45c5f91..b622ac4 100644 > --- a/lib/unicase.in.h > +++ b/lib/unicase.in.h > @@ -96,15 +96,15 @@ extern const char * > extern uint8_t * > u8_toupper (const uint8_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint8_t *resultbuf, size_t *lengthp); > + uint8_t * restrict resultbuf, size_t *lengthp); > extern uint16_t * > u16_toupper (const uint16_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint16_t *resultbuf, size_t *lengthp); > + uint16_t * restrict resultbuf, size_t *lengthp); > extern uint32_t * > u32_toupper (const uint32_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint32_t *resultbuf, size_t *lengthp); > + uint32_t * restrict resultbuf, size_t *lengthp); > > /* Return the lowercase mapping of a string. > The nf argument identifies the normalization form to apply after the > @@ -112,15 +112,15 @@ extern uint32_t * > extern uint8_t * > u8_tolower (const uint8_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint8_t *resultbuf, size_t *lengthp); > + uint8_t * restrict resultbuf, size_t *lengthp); > extern uint16_t * > u16_tolower (const uint16_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint16_t *resultbuf, size_t *lengthp); > + uint16_t * restrict resultbuf, size_t *lengthp); > extern uint32_t * > u32_tolower (const uint32_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint32_t *resultbuf, size_t *lengthp); > + uint32_t * restrict resultbuf, size_t *lengthp); > > /* Return the titlecase mapping of a string. > The nf argument identifies the normalization form to apply after the > @@ -128,15 +128,15 @@ extern uint32_t * > extern uint8_t * > u8_totitle (const uint8_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint8_t *resultbuf, size_t *lengthp); > + uint8_t * restrict resultbuf, size_t *lengthp); > extern uint16_t * > u16_totitle (const uint16_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint16_t *resultbuf, size_t *lengthp); > + uint16_t * restrict resultbuf, size_t *lengthp); > extern uint32_t * > u32_totitle (const uint32_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint32_t *resultbuf, size_t *lengthp); > + uint32_t * restrict resultbuf, size_t *lengthp); > > /* The case-mapping context given by a prefix string. */ > typedef struct casing_prefix_context > @@ -204,21 +204,21 @@ extern uint8_t * > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint8_t *resultbuf, size_t *lengthp); > + uint8_t * restrict resultbuf, size_t *lengthp); > extern uint16_t * > u16_ct_toupper (const uint16_t *s, size_t n, > casing_prefix_context_t prefix_context, > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint16_t *resultbuf, size_t *lengthp); > + uint16_t * restrict resultbuf, size_t *lengthp); > extern uint32_t * > u32_ct_toupper (const uint32_t *s, size_t n, > casing_prefix_context_t prefix_context, > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint32_t *resultbuf, size_t *lengthp); > + uint32_t * restrict resultbuf, size_t *lengthp); > > /* Return the lowercase mapping of a string that is surrounded by a prefix > and a suffix. */ > @@ -228,21 +228,21 @@ extern uint8_t * > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint8_t *resultbuf, size_t *lengthp); > + uint8_t * restrict resultbuf, size_t *lengthp); > extern uint16_t * > u16_ct_tolower (const uint16_t *s, size_t n, > casing_prefix_context_t prefix_context, > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint16_t *resultbuf, size_t *lengthp); > + uint16_t * restrict resultbuf, size_t *lengthp); > extern uint32_t * > u32_ct_tolower (const uint32_t *s, size_t n, > casing_prefix_context_t prefix_context, > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint32_t *resultbuf, size_t *lengthp); > + uint32_t * restrict resultbuf, size_t *lengthp); > > /* Return the titlecase mapping of a string that is surrounded by a prefix > and a suffix. */ > @@ -252,21 +252,21 @@ extern uint8_t * > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint8_t *resultbuf, size_t *lengthp); > + uint8_t * restrict resultbuf, size_t *lengthp); > extern uint16_t * > u16_ct_totitle (const uint16_t *s, size_t n, > casing_prefix_context_t prefix_context, > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint16_t *resultbuf, size_t *lengthp); > + uint16_t * restrict resultbuf, size_t *lengthp); > extern uint32_t * > u32_ct_totitle (const uint32_t *s, size_t n, > casing_prefix_context_t prefix_context, > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint32_t *resultbuf, size_t *lengthp); > + uint32_t * restrict resultbuf, size_t *lengthp); > > /* Return the case folded string. > Comparing uN_casefold (S1) and uN_casefold (S2) with uN_cmp2() is equivalent > @@ -276,15 +276,15 @@ extern uint32_t * > extern uint8_t * > u8_casefold (const uint8_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint8_t *resultbuf, size_t *lengthp); > + uint8_t * restrict resultbuf, size_t *lengthp); > extern uint16_t * > u16_casefold (const uint16_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint16_t *resultbuf, size_t *lengthp); > + uint16_t * restrict resultbuf, size_t *lengthp); > extern uint32_t * > u32_casefold (const uint32_t *s, size_t n, const char *iso639_language, > uninorm_t nf, > - uint32_t *resultbuf, size_t *lengthp); > + uint32_t * restrict resultbuf, size_t *lengthp); > /* Likewise, for a string that is surrounded by a prefix and a suffix. */ > extern uint8_t * > u8_ct_casefold (const uint8_t *s, size_t n, > @@ -292,21 +292,21 @@ extern uint8_t * > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint8_t *resultbuf, size_t *lengthp); > + uint8_t * restrict resultbuf, size_t *lengthp); > extern uint16_t * > u16_ct_casefold (const uint16_t *s, size_t n, > casing_prefix_context_t prefix_context, > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint16_t *resultbuf, size_t *lengthp); > + uint16_t * restrict resultbuf, size_t *lengthp); > extern uint32_t * > u32_ct_casefold (const uint32_t *s, size_t n, > casing_prefix_context_t prefix_context, > casing_suffix_context_t suffix_context, > const char *iso639_language, > uninorm_t nf, > - uint32_t *resultbuf, size_t *lengthp); > + uint32_t * restrict resultbuf, size_t *lengthp); > > /* Compare S1 and S2, ignoring differences in case and normalization. > The nf argument identifies the normalization form to apply after the > @@ -336,16 +336,16 @@ extern int > NF must be either UNINORM_NFC, UNINORM_NFKC, or NULL for no normalization. */ > extern char * > u8_casexfrm (const uint8_t *s, size_t n, const char *iso639_language, > - uninorm_t nf, char *resultbuf, size_t *lengthp); > + uninorm_t nf, char * restrict resultbuf, size_t *lengthp); > extern char * > u16_casexfrm (const uint16_t *s, size_t n, const char *iso639_language, > - uninorm_t nf, char *resultbuf, size_t *lengthp); > + uninorm_t nf, char * restrict resultbuf, size_t *lengthp); > extern char * > u32_casexfrm (const uint32_t *s, size_t n, const char *iso639_language, > - uninorm_t nf, char *resultbuf, size_t *lengthp); > + uninorm_t nf, char * restrict resultbuf, size_t *lengthp); > extern char * > ulc_casexfrm (const char *s, size_t n, const char *iso639_language, > - uninorm_t nf, char *resultbuf, size_t *lengthp); > + uninorm_t nf, char * restrict resultbuf, size_t *lengthp); > > /* Compare S1 and S2, ignoring differences in case and normalization, using the > collation rules of the current locale. > diff --git a/lib/uniconv.in.h b/lib/uniconv.in.h > index 53dc3fc..4e7f872 100644 > --- a/lib/uniconv.in.h > +++ b/lib/uniconv.in.h > @@ -98,19 +98,19 @@ extern char * > enum iconv_ilseq_handler handler, > const uint8_t *src, size_t srclen, > size_t *offsets, > - char *resultbuf, size_t *lengthp); > + char * restrict resultbuf, size_t *lengthp); > extern char * > u16_conv_to_encoding (const char *tocode, > enum iconv_ilseq_handler handler, > const uint16_t *src, size_t srclen, > size_t *offsets, > - char *resultbuf, size_t *lengthp); > + char * restrict resultbuf, size_t *lengthp); > extern char * > u32_conv_to_encoding (const char *tocode, > enum iconv_ilseq_handler handler, > const uint32_t *src, size_t srclen, > size_t *offsets, > - char *resultbuf, size_t *lengthp); > + char * restrict resultbuf, size_t *lengthp); > > /* Converts a NUL terminated string from a given encoding. > The result is malloc allocated, or NULL (with errno set) in case of error. > diff --git a/lib/unilbrk.in.h b/lib/unilbrk.in.h > index 408b905..83ba59c 100644 > --- a/lib/unilbrk.in.h > +++ b/lib/unilbrk.in.h > @@ -58,16 +58,16 @@ enum > */ > extern void > u8_possible_linebreaks (const uint8_t *s, size_t n, > - const char *encoding, char *p); > + const char *encoding, char * restrict p); > extern void > u16_possible_linebreaks (const uint16_t *s, size_t n, > - const char *encoding, char *p); > + const char *encoding, char * restrict p); > extern void > u32_possible_linebreaks (const uint32_t *s, size_t n, > - const char *encoding, char *p); > + const char *encoding, char * restrict p); > extern void > ulc_possible_linebreaks (const char *s, size_t n, > - const char *encoding, char *p); > + const char *encoding, char * restrict p); > > /* Choose the best line breaks, assuming the uc_width function. > The string is s[0..n-1]. The maximum number of columns per line is given > @@ -84,22 +84,22 @@ extern int > u8_width_linebreaks (const uint8_t *s, size_t n, int width, > int start_column, int at_end_columns, > const char *o, const char *encoding, > - char *p); > + char * restrict p); > extern int > u16_width_linebreaks (const uint16_t *s, size_t n, int width, > int start_column, int at_end_columns, > const char *o, const char *encoding, > - char *p); > + char * restrict p); > extern int > u32_width_linebreaks (const uint32_t *s, size_t n, int width, > int start_column, int at_end_columns, > const char *o, const char *encoding, > - char *p); > + char * restrict p); > extern int > ulc_width_linebreaks (const char *s, size_t n, int width, > int start_column, int at_end_columns, > const char *o, const char *encoding, > - char *p); > + char * restrict p); > > > #ifdef __cplusplus > diff --git a/lib/uninorm.in.h b/lib/uninorm.in.h > index 9ebdb6b..e4cb7d9 100644 > --- a/lib/uninorm.in.h > +++ b/lib/uninorm.in.h > @@ -143,13 +143,13 @@ extern uninorm_t > /* Return the specified normalization form of a string. */ > extern uint8_t * > u8_normalize (uninorm_t nf, const uint8_t *s, size_t n, > - uint8_t *resultbuf, size_t *lengthp); > + uint8_t * restrict resultbuf, size_t *lengthp); > extern uint16_t * > u16_normalize (uninorm_t nf, const uint16_t *s, size_t n, > - uint16_t *resultbuf, size_t *lengthp); > + uint16_t * restrict resultbuf, size_t *lengthp); > extern uint32_t * > u32_normalize (uninorm_t nf, const uint32_t *s, size_t n, > - uint32_t *resultbuf, size_t *lengthp); > + uint32_t * restrict resultbuf, size_t *lengthp); > > > /* Compare S1 and S2, ignoring differences in normalization. > diff --git a/lib/unistd.in.h b/lib/unistd.in.h > index 6db7ff2..297f6dd 100644 > --- a/lib/unistd.in.h > +++ b/lib/unistd.in.h > @@ -1370,18 +1370,18 @@ _GL_CXXALIASWARN (read); > # define readlink rpl_readlink > # endif > _GL_FUNCDECL_RPL (readlink, ssize_t, > - (const char *file, char *buf, size_t bufsize) > + (const char *file, char * restrict buf, size_t bufsize) > _GL_ARG_NONNULL ((1, 2))); > _GL_CXXALIAS_RPL (readlink, ssize_t, > - (const char *file, char *buf, size_t bufsize)); > + (const char *file, char * restrict buf, size_t bufsize)); > # else > # if !@HAVE_READLINK@ > _GL_FUNCDECL_SYS (readlink, ssize_t, > - (const char *file, char *buf, size_t bufsize) > + (const char *file, char * restrict buf, size_t bufsize) > _GL_ARG_NONNULL ((1, 2))); > # endif > _GL_CXXALIAS_SYS (readlink, ssize_t, > - (const char *file, char *buf, size_t bufsize)); > + (const char *file, char * restrict buf, size_t bufsize)); > # endif > _GL_CXXALIASWARN (readlink); > #elif defined GNULIB_POSIXCHECK > @@ -1399,18 +1399,18 @@ _GL_WARN_ON_USE (readlink, "readlink is unportable - " > # define readlinkat rpl_readlinkat > # endif > _GL_FUNCDECL_RPL (readlinkat, ssize_t, > - (int fd, char const *file, char *buf, size_t len) > + (int fd, char const *file, char * restrict buf, size_t len) > _GL_ARG_NONNULL ((2, 3))); > _GL_CXXALIAS_RPL (readlinkat, ssize_t, > - (int fd, char const *file, char *buf, size_t len)); > + (int fd, char const *file, char * restrict buf, size_t len)); > # else > # if !@HAVE_READLINKAT@ > _GL_FUNCDECL_SYS (readlinkat, ssize_t, > - (int fd, char const *file, char *buf, size_t len) > + (int fd, char const *file, char * restrict buf, size_t len) > _GL_ARG_NONNULL ((2, 3))); > # endif > _GL_CXXALIAS_SYS (readlinkat, ssize_t, > - (int fd, char const *file, char *buf, size_t len)); > + (int fd, char const *file, char * restrict buf, size_t len)); > # endif > _GL_CXXALIASWARN (readlinkat); > #elif defined GNULIB_POSIXCHECK > diff --git a/lib/unistdio.in.h b/lib/unistdio.in.h > index e6091ec..615d21b 100644 > --- a/lib/unistdio.in.h > +++ b/lib/unistdio.in.h > @@ -61,28 +61,28 @@ extern "C" { > > /* ASCII format string, result in locale dependent encoded 'char *'. */ > extern int > - ulc_sprintf (char *buf, > + ulc_sprintf (char * restrict buf, > const char *format, ...); > extern int > - ulc_snprintf (char *buf, size_t size, > + ulc_snprintf (char * restrict buf, size_t size, > const char *format, ...); > extern int > ulc_asprintf (char **resultp, > const char *format, ...); > extern char * > - ulc_asnprintf (char *resultbuf, size_t *lengthp, > + ulc_asnprintf (char * restrict resultbuf, size_t *lengthp, > const char *format, ...); > extern int > - ulc_vsprintf (char *buf, > + ulc_vsprintf (char * restrict buf, > const char *format, va_list ap); > extern int > - ulc_vsnprintf (char *buf, size_t size, > + ulc_vsnprintf (char * restrict buf, size_t size, > const char *format, va_list ap); > extern int > ulc_vasprintf (char **resultp, > const char *format, va_list ap); > extern char * > - ulc_vasnprintf (char *resultbuf, size_t *lengthp, > + ulc_vasnprintf (char * restrict resultbuf, size_t *lengthp, > const char *format, va_list ap); > > /* ASCII format string, result in UTF-8 format. */ > @@ -113,28 +113,28 @@ extern uint8_t * > > /* UTF-8 format string, result in UTF-8 format. */ > extern int > - u8_u8_sprintf (uint8_t *buf, > + u8_u8_sprintf (uint8_t * restrict buf, > const uint8_t *format, ...); > extern int > - u8_u8_snprintf (uint8_t *buf, size_t size, > + u8_u8_snprintf (uint8_t * restrict buf, size_t size, > const uint8_t *format, ...); > extern int > u8_u8_asprintf (uint8_t **resultp, > const uint8_t *format, ...); > extern uint8_t * > - u8_u8_asnprintf (uint8_t *resultbuf, size_t *lengthp, > + u8_u8_asnprintf (uint8_t * restrict resultbuf, size_t *lengthp, > const uint8_t *format, ...); > extern int > - u8_u8_vsprintf (uint8_t *buf, > + u8_u8_vsprintf (uint8_t * restrict buf, > const uint8_t *format, va_list ap); > extern int > - u8_u8_vsnprintf (uint8_t *buf, size_t size, > + u8_u8_vsnprintf (uint8_t * restrict buf, size_t size, > const uint8_t *format, va_list ap); > extern int > u8_u8_vasprintf (uint8_t **resultp, > const uint8_t *format, va_list ap); > extern uint8_t * > - u8_u8_vasnprintf (uint8_t *resultbuf, size_t *lengthp, > + u8_u8_vasnprintf (uint8_t * restrict resultbuf, size_t *lengthp, > const uint8_t *format, va_list ap); > > /* ASCII format string, result in UTF-16 format. */ > @@ -165,28 +165,28 @@ extern uint16_t * > > /* UTF-16 format string, result in UTF-16 format. */ > extern int > - u16_u16_sprintf (uint16_t *buf, > + u16_u16_sprintf (uint16_t * restrict buf, > const uint16_t *format, ...); > extern int > - u16_u16_snprintf (uint16_t *buf, size_t size, > + u16_u16_snprintf (uint16_t * restrict buf, size_t size, > const uint16_t *format, ...); > extern int > u16_u16_asprintf (uint16_t **resultp, > const uint16_t *format, ...); > extern uint16_t * > - u16_u16_asnprintf (uint16_t *resultbuf, size_t *lengthp, > + u16_u16_asnprintf (uint16_t * restrict resultbuf, size_t *lengthp, > const uint16_t *format, ...); > extern int > - u16_u16_vsprintf (uint16_t *buf, > + u16_u16_vsprintf (uint16_t * restrict buf, > const uint16_t *format, va_list ap); > extern int > - u16_u16_vsnprintf (uint16_t *buf, size_t size, > + u16_u16_vsnprintf (uint16_t * restrict buf, size_t size, > const uint16_t *format, va_list ap); > extern int > u16_u16_vasprintf (uint16_t **resultp, > const uint16_t *format, va_list ap); > extern uint16_t * > - u16_u16_vasnprintf (uint16_t *resultbuf, size_t *lengthp, > + u16_u16_vasnprintf (uint16_t * restrict resultbuf, size_t *lengthp, > const uint16_t *format, va_list ap); > > /* ASCII format string, result in UTF-32 format. */ > @@ -217,28 +217,28 @@ extern uint32_t * > > /* UTF-32 format string, result in UTF-32 format. */ > extern int > - u32_u32_sprintf (uint32_t *buf, > + u32_u32_sprintf (uint32_t * restrict buf, > const uint32_t *format, ...); > extern int > - u32_u32_snprintf (uint32_t *buf, size_t size, > + u32_u32_snprintf (uint32_t * restrict buf, size_t size, > const uint32_t *format, ...); > extern int > u32_u32_asprintf (uint32_t **resultp, > const uint32_t *format, ...); > extern uint32_t * > - u32_u32_asnprintf (uint32_t *resultbuf, size_t *lengthp, > + u32_u32_asnprintf (uint32_t * restrict resultbuf, size_t *lengthp, > const uint32_t *format, ...); > extern int > - u32_u32_vsprintf (uint32_t *buf, > + u32_u32_vsprintf (uint32_t * restrict buf, > const uint32_t *format, va_list ap); > extern int > - u32_u32_vsnprintf (uint32_t *buf, size_t size, > + u32_u32_vsnprintf (uint32_t * restrict buf, size_t size, > const uint32_t *format, va_list ap); > extern int > u32_u32_vasprintf (uint32_t **resultp, > const uint32_t *format, va_list ap); > extern uint32_t * > - u32_u32_vasnprintf (uint32_t *resultbuf, size_t *lengthp, > + u32_u32_vasnprintf (uint32_t * restrict resultbuf, size_t *lengthp, > const uint32_t *format, va_list ap); > > /* ASCII format string, output to FILE in locale dependent encoding. */ > diff --git a/lib/unistr.in.h b/lib/unistr.in.h > index bc0d237..c580774 100644 > --- a/lib/unistr.in.h > +++ b/lib/unistr.in.h > @@ -373,11 +373,11 @@ u32_uctomb (uint32_t *s, ucs4_t uc, int n) > /* Copy N units from SRC to DEST. */ > /* Similar to memcpy(). */ > extern uint8_t * > - u8_cpy (uint8_t *dest, const uint8_t *src, size_t n); > + u8_cpy (uint8_t * restrict dest, const uint8_t *src, size_t n); > extern uint16_t * > - u16_cpy (uint16_t *dest, const uint16_t *src, size_t n); > + u16_cpy (uint16_t * restrict dest, const uint16_t *src, size_t n); > extern uint32_t * > - u32_cpy (uint32_t *dest, const uint32_t *src, size_t n); > + u32_cpy (uint32_t * restrict dest, const uint32_t *src, size_t n); > > /* Copy N units from SRC to DEST, guaranteeing correct behavior for > overlapping memory areas. */ > @@ -528,57 +528,57 @@ extern size_t > /* Copy SRC to DEST. */ > /* Similar to strcpy(), wcscpy(). */ > extern uint8_t * > - u8_strcpy (uint8_t *dest, const uint8_t *src); > + u8_strcpy (uint8_t * restrict dest, const uint8_t *src); > extern uint16_t * > - u16_strcpy (uint16_t *dest, const uint16_t *src); > + u16_strcpy (uint16_t * restrict dest, const uint16_t *src); > extern uint32_t * > - u32_strcpy (uint32_t *dest, const uint32_t *src); > + u32_strcpy (uint32_t * restrict dest, const uint32_t *src); > > /* Copy SRC to DEST, returning the address of the terminating NUL in DEST. */ > /* Similar to stpcpy(). */ > extern uint8_t * > - u8_stpcpy (uint8_t *dest, const uint8_t *src); > + u8_stpcpy (uint8_t * restrict dest, const uint8_t *src); > extern uint16_t * > - u16_stpcpy (uint16_t *dest, const uint16_t *src); > + u16_stpcpy (uint16_t * restrict dest, const uint16_t *src); > extern uint32_t * > - u32_stpcpy (uint32_t *dest, const uint32_t *src); > + u32_stpcpy (uint32_t * restrict dest, const uint32_t *src); > > /* Copy no more than N units of SRC to DEST. */ > /* Similar to strncpy(), wcsncpy(). */ > extern uint8_t * > - u8_strncpy (uint8_t *dest, const uint8_t *src, size_t n); > + u8_strncpy (uint8_t * restrict dest, const uint8_t *src, size_t n); > extern uint16_t * > - u16_strncpy (uint16_t *dest, const uint16_t *src, size_t n); > + u16_strncpy (uint16_t * restrict dest, const uint16_t *src, size_t n); > extern uint32_t * > - u32_strncpy (uint32_t *dest, const uint32_t *src, size_t n); > + u32_strncpy (uint32_t * restrict dest, const uint32_t *src, size_t n); > > /* Copy no more than N units of SRC to DEST. Return a pointer past the last > non-NUL unit written into DEST. */ > /* Similar to stpncpy(). */ > extern uint8_t * > - u8_stpncpy (uint8_t *dest, const uint8_t *src, size_t n); > + u8_stpncpy (uint8_t * restrict dest, const uint8_t *src, size_t n); > extern uint16_t * > - u16_stpncpy (uint16_t *dest, const uint16_t *src, size_t n); > + u16_stpncpy (uint16_t * restrict dest, const uint16_t *src, size_t n); > extern uint32_t * > - u32_stpncpy (uint32_t *dest, const uint32_t *src, size_t n); > + u32_stpncpy (uint32_t * restrict dest, const uint32_t *src, size_t n); > > /* Append SRC onto DEST. */ > /* Similar to strcat(), wcscat(). */ > extern uint8_t * > - u8_strcat (uint8_t *dest, const uint8_t *src); > + u8_strcat (uint8_t * restrict dest, const uint8_t *src); > extern uint16_t * > - u16_strcat (uint16_t *dest, const uint16_t *src); > + u16_strcat (uint16_t * restrict dest, const uint16_t *src); > extern uint32_t * > - u32_strcat (uint32_t *dest, const uint32_t *src); > + u32_strcat (uint32_t * restrict dest, const uint32_t *src); > > /* Append no more than N units of SRC onto DEST. */ > /* Similar to strncat(), wcsncat(). */ > extern uint8_t * > - u8_strncat (uint8_t *dest, const uint8_t *src, size_t n); > + u8_strncat (uint8_t * restrict dest, const uint8_t *src, size_t n); > extern uint16_t * > - u16_strncat (uint16_t *dest, const uint16_t *src, size_t n); > + u16_strncat (uint16_t * restrict dest, const uint16_t *src, size_t n); > extern uint32_t * > - u32_strncat (uint32_t *dest, const uint32_t *src, size_t n); > + u32_strncat (uint32_t * restrict dest, const uint32_t *src, size_t n); > > /* Compare S1 and S2. */ > /* Similar to strcmp(), wcscmp(). */ > @@ -732,11 +732,14 @@ extern bool > This interface is actually more similar to wcstok than to strtok. */ > /* Similar to strtok_r(), wcstok(). */ > extern uint8_t * > - u8_strtok (uint8_t *str, const uint8_t *delim, uint8_t **ptr); > + u8_strtok (uint8_t * restrict str, const uint8_t *delim, > + uint8_t **ptr); > extern uint16_t * > - u16_strtok (uint16_t *str, const uint16_t *delim, uint16_t **ptr); > + u16_strtok (uint16_t * restrict str, const uint16_t *delim, > + uint16_t **ptr); > extern uint32_t * > - u32_strtok (uint32_t *str, const uint32_t *delim, uint32_t **ptr); > + u32_strtok (uint32_t * restrict str, const uint32_t *delim, > + uint32_t **ptr); > > > #ifdef __cplusplus > diff --git a/lib/uniwbrk.in.h b/lib/uniwbrk.in.h > index 1407644..940ae7d 100644 > --- a/lib/uniwbrk.in.h > +++ b/lib/uniwbrk.in.h > @@ -81,7 +81,7 @@ extern void > extern void > u32_wordbreaks (const uint32_t *s, size_t n, char *p); > extern void > - ulc_wordbreaks (const char *s, size_t n, char *p); > + ulc_wordbreaks (const char *s, size_t n, char * restrict p); > > /* ========================================================================= */ > > diff --git a/lib/vasnprintf.h b/lib/vasnprintf.h > index 345e6a8..58b9912 100644 > --- a/lib/vasnprintf.h > +++ b/lib/vasnprintf.h > @@ -67,9 +67,11 @@ extern "C" { > # define asnprintf rpl_asnprintf > # define vasnprintf rpl_vasnprintf > #endif > -extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) > +extern char * asnprintf (char * restrict resultbuf, size_t *lengthp, > + const char *format, ...) > _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4)); > -extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) > +extern char * vasnprintf (char * restrict resultbuf, size_t *lengthp, > + const char *format, va_list args) > _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0)); > > #ifdef __cplusplus > diff --git a/lib/wchar.in.h b/lib/wchar.in.h > index 74cd670..16f9d6c 100644 > --- a/lib/wchar.in.h > +++ b/lib/wchar.in.h > @@ -547,10 +547,10 @@ _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - " > #if @GNULIB_WMEMCPY@ > # if !@HAVE_WMEMCPY@ > _GL_FUNCDECL_SYS (wmemcpy, wchar_t *, > - (wchar_t *dest, const wchar_t *src, size_t n)); > + (wchar_t * restrict dest, const wchar_t *src, size_t n)); > # endif > _GL_CXXALIAS_SYS (wmemcpy, wchar_t *, > - (wchar_t *dest, const wchar_t *src, size_t n)); > + (wchar_t * restrict dest, const wchar_t *src, size_t n)); > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (wmemcpy); > # endif > @@ -640,9 +640,11 @@ _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - " > /* Copy SRC to DEST. */ > #if @GNULIB_WCSCPY@ > # if !@HAVE_WCSCPY@ > -_GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); > +_GL_FUNCDECL_SYS (wcscpy, wchar_t *, > + (wchar_t * restrict dest, const wchar_t *src)); > # endif > -_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); > +_GL_CXXALIAS_SYS (wcscpy, wchar_t *, > + (wchar_t * restrict dest, const wchar_t *src)); > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (wcscpy); > # endif > @@ -658,9 +660,11 @@ _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - " > /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */ > #if @GNULIB_WCPCPY@ > # if !@HAVE_WCPCPY@ > -_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); > +_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, > + (wchar_t * restrict dest, const wchar_t *src)); > # endif > -_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src)); > +_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, > + (wchar_t * restrict dest, const wchar_t *src)); > _GL_CXXALIASWARN (wcpcpy); > #elif defined GNULIB_POSIXCHECK > # undef wcpcpy > @@ -675,10 +679,10 @@ _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - " > #if @GNULIB_WCSNCPY@ > # if !@HAVE_WCSNCPY@ > _GL_FUNCDECL_SYS (wcsncpy, wchar_t *, > - (wchar_t *dest, const wchar_t *src, size_t n)); > + (wchar_t * restrict dest, const wchar_t *src, size_t n)); > # endif > _GL_CXXALIAS_SYS (wcsncpy, wchar_t *, > - (wchar_t *dest, const wchar_t *src, size_t n)); > + (wchar_t * restrict dest, const wchar_t *src, size_t n)); > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (wcsncpy); > # endif > @@ -696,10 +700,10 @@ _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - " > #if @GNULIB_WCPNCPY@ > # if !@HAVE_WCPNCPY@ > _GL_FUNCDECL_SYS (wcpncpy, wchar_t *, > - (wchar_t *dest, const wchar_t *src, size_t n)); > + (wchar_t * restrict dest, const wchar_t *src, size_t n)); > # endif > _GL_CXXALIAS_SYS (wcpncpy, wchar_t *, > - (wchar_t *dest, const wchar_t *src, size_t n)); > + (wchar_t * restrict dest, const wchar_t *src, size_t n)); > _GL_CXXALIASWARN (wcpncpy); > #elif defined GNULIB_POSIXCHECK > # undef wcpncpy > @@ -713,9 +717,11 @@ _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - " > /* Append SRC onto DEST. */ > #if @GNULIB_WCSCAT@ > # if !@HAVE_WCSCAT@ > -_GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src)); > +_GL_FUNCDECL_SYS (wcscat, wchar_t *, > + (wchar_t * restrict dest, const wchar_t *src)); > # endif > -_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src)); > +_GL_CXXALIAS_SYS (wcscat, wchar_t *, > + (wchar_t * restrict dest, const wchar_t *src)); > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (wcscat); > # endif > @@ -732,10 +738,10 @@ _GL_WARN_ON_USE (wcscat, "wcscat is unportable - " > #if @GNULIB_WCSNCAT@ > # if !@HAVE_WCSNCAT@ > _GL_FUNCDECL_SYS (wcsncat, wchar_t *, > - (wchar_t *dest, const wchar_t *src, size_t n)); > + (wchar_t * restrict dest, const wchar_t *src, size_t n)); > # endif > _GL_CXXALIAS_SYS (wcsncat, wchar_t *, > - (wchar_t *dest, const wchar_t *src, size_t n)); > + (wchar_t * restrict dest, const wchar_t *src, size_t n)); > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (wcsncat); > # endif > @@ -848,9 +854,11 @@ _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - " > original strings. */ > #if @GNULIB_WCSXFRM@ > # if !@HAVE_WCSXFRM@ > -_GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n)); > +_GL_FUNCDECL_SYS (wcsxfrm, size_t, > + (wchar_t * restrict s1, const wchar_t *s2, size_t n)); > # endif > -_GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n)); > +_GL_CXXALIAS_SYS (wcsxfrm, size_t, > + (wchar_t * restrict s1, const wchar_t *s2, size_t n)); > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (wcsxfrm); > # endif > @@ -1053,16 +1061,20 @@ _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - " > # define wcstok rpl_wcstok > # endif > _GL_FUNCDECL_RPL (wcstok, wchar_t *, > - (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)); > + (wchar_t * restrict wcs, const wchar_t *delim, > + wchar_t **ptr)); > _GL_CXXALIAS_RPL (wcstok, wchar_t *, > - (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)); > + (wchar_t * restrict wcs, const wchar_t *delim, > + wchar_t **ptr)); > # else > # if !@HAVE_WCSTOK@ > _GL_FUNCDECL_SYS (wcstok, wchar_t *, > - (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)); > + (wchar_t * restrict wcs, const wchar_t *delim, > + wchar_t **ptr)); > # endif > _GL_CXXALIAS_SYS (wcstok, wchar_t *, > - (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr)); > + (wchar_t * restrict wcs, const wchar_t *delim, > + wchar_t **ptr)); > # endif > # if __GLIBC__ >= 2 > _GL_CXXALIASWARN (wcstok); > @@ -1114,18 +1126,18 @@ _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - " > # undef wcsftime > # define wcsftime rpl_wcsftime > # endif > -_GL_FUNCDECL_RPL (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, > +_GL_FUNCDECL_RPL (wcsftime, size_t, (wchar_t * restrict __buf, size_t __bufsize, > const wchar_t *__fmt, const struct tm *__tp) > _GL_ARG_NONNULL ((1, 3, 4))); > -_GL_CXXALIAS_RPL (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, > +_GL_CXXALIAS_RPL (wcsftime, size_t, (wchar_t * restrict __buf, size_t __bufsize, > const wchar_t *__fmt, const struct tm *__tp)); > # else > # if !@HAVE_WCSFTIME@ > -_GL_FUNCDECL_SYS (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, > +_GL_FUNCDECL_SYS (wcsftime, size_t, (wchar_t * restrict __buf, size_t __bufsize, > const wchar_t *__fmt, const struct tm *__tp) > _GL_ARG_NONNULL ((1, 3, 4))); > # endif > -_GL_CXXALIAS_SYS (wcsftime, size_t, (wchar_t *__buf, size_t __bufsize, > +_GL_CXXALIAS_SYS (wcsftime, size_t, (wchar_t * restrict __buf, size_t __bufsize, > const wchar_t *__fmt, const struct tm *__tp)); > # endif > # if __GLIBC__ >= 2 > diff --git a/lib/xmemcoll.h b/lib/xmemcoll.h > index 4170b9b..ea546b8 100644 > --- a/lib/xmemcoll.h > +++ b/lib/xmemcoll.h > @@ -1,3 +1,3 @@ > #include > -int xmemcoll (char *, size_t, char *, size_t); > +int xmemcoll (char * restrict, size_t, char * restrict, size_t); > int xmemcoll0 (char const *, size_t, char const *, size_t); > > >