1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-23 07:31:31 +00:00

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
This commit is contained in:
Alfonso Gregory 2021-07-14 15:48:35 -06:00 committed by Warner Losh
parent 7f5508fe78
commit 56d33e86b7
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -174,8 +174,8 @@ char *strchr(const char *, int);
char *strchrnul(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 *);