Date: Wed, 21 Jul 2021 16:18:52 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 18b511454f77 - stable/12 - Remove incorrect __restricted labels from strcspn Message-ID: <202107211618.16LGIqYJ081428@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=18b511454f779305f828b71ad5df69d1c1a3b3ba commit 18b511454f779305f828b71ad5df69d1c1a3b3ba Author: Alfonso Gregory <gfunni234@gmail.com> AuthorDate: 2021-07-14 21:48:35 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-07-21 16:16:32 +0000 Remove incorrect __restricted labels from strcspn strcspn should never have had the __restrict keywords. While both of these strings are const, it may have unindended side effects. While this is the kernel, the POSIX definition also omits restrict. Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/497 (cherry picked from commit 56d33e86b74b197a36f42255824b56715c96a596) --- sys/libkern/strcspn.c | 2 +- sys/sys/libkern.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/libkern/strcspn.c b/sys/libkern/strcspn.c index fce6d4b8b071..62bfcf78eeb7 100644 --- a/sys/libkern/strcspn.c +++ b/sys/libkern/strcspn.c @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #define BIT(c) ((u_long)1 << ((u_char)(c) % LONG_BIT)) size_t -strcspn(const char * __restrict s, const char * __restrict charset) +strcspn(const char *s, const char *charset) { /* * NB: idx and bit are temporaries whose use causes gcc 3.4.2 to diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index 0c4e1381be1a..b8855cba6d95 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -173,8 +173,8 @@ char *strcat(char * __restrict, const char * __restrict); char *strchr(const char *, int); int strcmp(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); -size_t strcspn(const char * __restrict, const char * __restrict) __pure; char *strdup_flags(const char *__restrict, struct malloc_type *, int); +size_t strcspn(const char *, const char *) __pure; char *strdup(const char *__restrict, struct malloc_type *); char *strncat(char *, const char *, size_t); char *strndup(const char *__restrict, size_t, struct malloc_type *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107211618.16LGIqYJ081428>