Remove restrict/__restrict.

We've never really used __restrict: only <string.h> and <stdio.h> (which
are still very similar to upstream BSD headers) consistently have these
annotations. Neither clang nor GCC warns for trivial cases, and there's
little obvious documentation benefit.

Bug: http://b/30833514
Test: builds
Change-Id: I3e4384281865475d0c55d764b546d8166419ee31
diff --git a/libc/SECCOMP_WHITELIST.TXT b/libc/SECCOMP_WHITELIST.TXT
index 0b9dad3..9e417c4 100644
--- a/libc/SECCOMP_WHITELIST.TXT
+++ b/libc/SECCOMP_WHITELIST.TXT
@@ -63,7 +63,7 @@
 
 # b/34651972
 int	access:access(const char *pathname, int mode)	arm,x86,mips
-int	stat64:stat64(const char *restrict path, struct stat64 *restrict buf)	arm,x86,mips
+int	stat64:stat64(const char*, struct stat64*)	arm,x86,mips
 
 # b/34813887
 int	open:open(const char *path, int oflag, ... ) arm,x86,mips
@@ -88,7 +88,7 @@
 int	unlink:unlink(const char *pathname)	arm,x86,mips
 
 # b/35059702
-int	lstat64:lstat64(const char *restrict path, struct stat64 *restrict buf)	arm,x86,mips
+int	lstat64:lstat64(const char*, struct stat64*)	arm,x86,mips
 
 # b/35217603
 int	fcntl:fcntl(int fd, int cmd, ... /* arg */ )	arm,x86,mips
@@ -126,4 +126,4 @@
 int compat_select:_newselect(int n, unsigned long* inp, unsigned long* outp, unsigned long* exp, struct timeval* timeout) arm,x86,mips
 
 # b/62090571
-int mkdir(const char *pathname, mode_t mode)	arm,x86,mips
\ No newline at end of file
+int mkdir(const char *pathname, mode_t mode)	arm,x86,mips
diff --git a/libc/bionic/fortify.cpp b/libc/bionic/fortify.cpp
index 4a7ff13..eaf5387 100644
--- a/libc/bionic/fortify.cpp
+++ b/libc/bionic/fortify.cpp
@@ -103,8 +103,7 @@
   return fgets(dst, supplied_size, stream);
 }
 
-size_t __fread_chk(void* __restrict buf, size_t size, size_t count,
-                   FILE* __restrict stream, size_t buf_size) {
+size_t __fread_chk(void* buf, size_t size, size_t count, FILE* stream, size_t buf_size) {
   size_t total;
   if (__predict_false(__size_mul_overflow(size, count, &total))) {
     // overflow: trigger the error path in fread
@@ -114,8 +113,7 @@
   return fread(buf, size, count, stream);
 }
 
-size_t __fwrite_chk(const void* __restrict buf, size_t size, size_t count,
-                    FILE* __restrict stream, size_t buf_size) {
+size_t __fwrite_chk(const void* buf, size_t size, size_t count, FILE* stream, size_t buf_size) {
   size_t total;
   if (__predict_false(__size_mul_overflow(size, count, &total))) {
     // overflow: trigger the error path in fwrite
@@ -239,8 +237,7 @@
 }
 
 // Runtime implementation of __builtin____stpncpy_chk (used directly by compiler, not in headers).
-extern "C" char* __stpncpy_chk(char* __restrict dst, const char* __restrict src,
-                               size_t len, size_t dst_len) {
+extern "C" char* __stpncpy_chk(char* dst, const char* src, size_t len, size_t dst_len) {
   __check_buffer_access("stpncpy", "write into", len, dst_len);
   return stpncpy(dst, src, len);
 }
@@ -249,8 +246,7 @@
 // sure we don't read beyond the end of "src". The code for this is
 // based on the original version of stpncpy, but modified to check
 // how much we read from "src" at the end of the copy operation.
-char* __stpncpy_chk2(char* __restrict dst, const char* __restrict src,
-                     size_t n, size_t dst_len, size_t src_len) {
+char* __stpncpy_chk2(char* dst, const char* src, size_t n, size_t dst_len, size_t src_len) {
   __check_buffer_access("stpncpy", "write into", n, dst_len);
   if (n != 0) {
     char* d = dst;
@@ -325,8 +321,7 @@
 }
 
 // Runtime implementation of __builtin____strncat_chk (used directly by compiler, not in headers).
-extern "C" char* __strncat_chk(char* __restrict dst, const char* __restrict src,
-                               size_t len, size_t dst_buf_size) {
+extern "C" char* __strncat_chk(char* dst, const char* src, size_t len, size_t dst_buf_size) {
   if (len == 0) {
     return dst;
   }
@@ -353,8 +348,7 @@
 }
 
 // Runtime implementation of __builtin____strncpy_chk (used directly by compiler, not in headers).
-extern "C" char* __strncpy_chk(char* __restrict dst, const char* __restrict src,
-                               size_t len, size_t dst_len) {
+extern "C" char* __strncpy_chk(char* dst, const char* src, size_t len, size_t dst_len) {
   __check_buffer_access("strncpy", "write into", len, dst_len);
   return strncpy(dst, src, len);
 }
@@ -363,8 +357,7 @@
 // sure we don't read beyond the end of "src". The code for this is
 // based on the original version of strncpy, but modified to check
 // how much we read from "src" at the end of the copy operation.
-char* __strncpy_chk2(char* __restrict dst, const char* __restrict src,
-                                size_t n, size_t dst_len, size_t src_len) {
+char* __strncpy_chk2(char* dst, const char* src, size_t n, size_t dst_len, size_t src_len) {
   __check_buffer_access("strncpy", "write into", n, dst_len);
   if (n != 0) {
     char* d = dst;
@@ -459,8 +452,7 @@
 
 #if !defined(NO___STRCAT_CHK)
 // Runtime implementation of __builtin____strcat_chk (used directly by compiler, not in headers).
-extern "C" char* __strcat_chk(char* __restrict dst, const char* __restrict src,
-                              size_t dst_buf_size) {
+extern "C" char* __strcat_chk(char* dst, const char* src, size_t dst_buf_size) {
   char* save = dst;
   size_t dst_len = __strlen_chk(dst, dst_buf_size);
 
diff --git a/libc/include/bits/fortify/stdio.h b/libc/include/bits/fortify/stdio.h
index dce056a..22dc217 100644
--- a/libc/include/bits/fortify/stdio.h
+++ b/libc/include/bits/fortify/stdio.h
@@ -31,10 +31,8 @@
 #endif
 
 char* __fgets_chk(char*, int, FILE*, size_t) __INTRODUCED_IN(17);
-size_t __fread_chk(void* __restrict, size_t, size_t, FILE* __restrict, size_t)
-    __INTRODUCED_IN(24);
-size_t __fwrite_chk(const void* __restrict, size_t, size_t, FILE* __restrict, size_t)
-    __INTRODUCED_IN(24);
+size_t __fread_chk(void*, size_t, size_t, FILE*, size_t) __INTRODUCED_IN(24);
+size_t __fwrite_chk(const void*, size_t, size_t, FILE*, size_t) __INTRODUCED_IN(24);
 
 #if defined(__BIONIC_FORTIFY) && !defined(__BIONIC_NO_STDIO_FORTIFY)
 
@@ -59,7 +57,7 @@
  * its length to the length of `dest`
  */
 __BIONIC_ERROR_FUNCTION_VISIBILITY
-int snprintf(char *__restrict dest, size_t size, const char *__restrict format)
+int snprintf(char* dest, size_t size, const char* format)
     __overloadable
     __enable_if(__bos(dest) != __BIONIC_FORTIFY_UNKNOWN_SIZE &&
                 __bos(dest) < __builtin_strlen(format),
@@ -68,8 +66,8 @@
 
 __BIONIC_FORTIFY_INLINE
 __printflike(3, 4)
-int snprintf(char *__restrict const __pass_object_size dest,
-             size_t size, const char *__restrict format, ...) __overloadable {
+int snprintf(char* const __pass_object_size dest,
+             size_t size, const char* format, ...) __overloadable {
     va_list va;
     va_start(va, format);
     int result = __builtin___vsnprintf_chk(dest, size, 0, __bos(dest), format, va);
@@ -78,7 +76,7 @@
 }
 
 __BIONIC_ERROR_FUNCTION_VISIBILITY
-int sprintf(char *__restrict dest, const char *__restrict format) __overloadable
+int sprintf(char* dest, const char* format) __overloadable
     __enable_if(__bos(dest) != __BIONIC_FORTIFY_UNKNOWN_SIZE &&
                 __bos(dest) < __builtin_strlen(format),
                 "format string will always overflow destination buffer")
@@ -86,8 +84,7 @@
 
 __BIONIC_FORTIFY_INLINE
 __printflike(2, 3)
-int sprintf(char *__restrict const __pass_object_size dest,
-        const char *__restrict format, ...) __overloadable {
+int sprintf(char* const __pass_object_size dest, const char* format, ...) __overloadable {
     va_list va;
     va_start(va, format);
     int result = __builtin___vsprintf_chk(dest, 0, __bos(dest), format, va);
@@ -98,22 +95,21 @@
 
 #if __ANDROID_API__ >= __ANDROID_API_N__
 __BIONIC_FORTIFY_INLINE
-size_t fread(void *__restrict buf, size_t size, size_t count,
-             FILE *__restrict stream) __overloadable
+size_t fread(void* buf, size_t size, size_t count,
+             FILE* stream) __overloadable
         __enable_if(__unsafe_check_mul_overflow(size, count), "size * count overflows")
         __errorattr("size * count overflows");
 
 __BIONIC_FORTIFY_INLINE
-size_t fread(void *__restrict buf, size_t size, size_t count,
-             FILE *__restrict stream) __overloadable
+size_t fread(void* buf, size_t size, size_t count, FILE* stream) __overloadable
     __enable_if(!__unsafe_check_mul_overflow(size, count), "no overflow")
     __enable_if(__bos(buf) != __BIONIC_FORTIFY_UNKNOWN_SIZE &&
                 size * count > __bos(buf), "size * count is too large")
     __errorattr("size * count is too large");
 
 __BIONIC_FORTIFY_INLINE
-size_t fread(void *__restrict const __pass_object_size0 buf, size_t size,
-             size_t count, FILE *__restrict stream) __overloadable {
+size_t fread(void* const __pass_object_size0 buf, size_t size,
+             size_t count, FILE* stream) __overloadable {
     size_t bos = __bos0(buf);
 
     if (bos == __BIONIC_FORTIFY_UNKNOWN_SIZE) {
@@ -123,22 +119,19 @@
     return __fread_chk(buf, size, count, stream, bos);
 }
 
-size_t fwrite(const void * __restrict buf, size_t size,
-              size_t count, FILE * __restrict stream) __overloadable
+size_t fwrite(const void* buf, size_t size, size_t count, FILE* stream) __overloadable
     __enable_if(__unsafe_check_mul_overflow(size, count),
                 "size * count overflows")
     __errorattr("size * count overflows");
 
-size_t fwrite(const void * __restrict buf, size_t size,
-              size_t count, FILE * __restrict stream) __overloadable
+size_t fwrite(const void* buf, size_t size, size_t count, FILE* stream) __overloadable
     __enable_if(!__unsafe_check_mul_overflow(size, count), "no overflow")
     __enable_if(__bos(buf) != __BIONIC_FORTIFY_UNKNOWN_SIZE &&
                 size * count > __bos(buf), "size * count is too large")
     __errorattr("size * count is too large");
 
 __BIONIC_FORTIFY_INLINE
-size_t fwrite(const void * __restrict const __pass_object_size0 buf,
-              size_t size, size_t count, FILE * __restrict stream)
+size_t fwrite(const void* const __pass_object_size0 buf, size_t size, size_t count, FILE* stream)
         __overloadable {
     size_t bos = __bos0(buf);
 
@@ -152,7 +145,7 @@
 
 #if __ANDROID_API__ >= __ANDROID_API_J_MR1__
 __BIONIC_ERROR_FUNCTION_VISIBILITY
-char *fgets(char* __restrict dest, int size, FILE* stream) __overloadable
+char *fgets(char* dest, int size, FILE* stream) __overloadable
     __enable_if(size < 0, "size is negative")
     __errorattr("size is negative");
 
@@ -163,8 +156,7 @@
     __errorattr("size is larger than the destination buffer");
 
 __BIONIC_FORTIFY_INLINE
-char *fgets(char* __restrict const __pass_object_size dest,
-        int size, FILE* stream) __overloadable {
+char *fgets(char* const __pass_object_size dest, int size, FILE* stream) __overloadable {
     size_t bos = __bos(dest);
 
     if (bos == __BIONIC_FORTIFY_UNKNOWN_SIZE) {
@@ -177,7 +169,7 @@
 
 #else /* defined(__clang__) */
 
-size_t __fread_real(void * __restrict, size_t, size_t, FILE * __restrict) __RENAME(fread);
+size_t __fread_real(void*, size_t, size_t, FILE*) __RENAME(fread);
 __errordecl(__fread_too_big_error, "fread called with size * count bigger than buffer");
 __errordecl(__fread_overflow, "fread called with overflowing size * count");
 
@@ -185,21 +177,20 @@
 __errordecl(__fgets_too_big_error, "fgets called with size bigger than buffer");
 __errordecl(__fgets_too_small_error, "fgets called with size less than zero");
 
-size_t __fwrite_real(const void * __restrict, size_t, size_t, FILE * __restrict) __RENAME(fwrite);
+size_t __fwrite_real(const void*, size_t, size_t, FILE*) __RENAME(fwrite);
 __errordecl(__fwrite_too_big_error, "fwrite called with size * count bigger than buffer");
 __errordecl(__fwrite_overflow, "fwrite called with overflowing size * count");
 
 
 #if __ANDROID_API__ >= __ANDROID_API_J_MR1__
 __BIONIC_FORTIFY_INLINE __printflike(3, 4)
-int snprintf(char *__restrict dest, size_t size, const char* _Nonnull format, ...)
-{
+int snprintf(char* dest, size_t size, const char* _Nonnull format, ...) {
     return __builtin___snprintf_chk(dest, size, 0, __bos(dest), format,
                                     __builtin_va_arg_pack());
 }
 
 __BIONIC_FORTIFY_INLINE __printflike(2, 3)
-int sprintf(char *__restrict dest, const char* _Nonnull format, ...) {
+int sprintf(char* dest, const char* _Nonnull format, ...) {
     return __builtin___sprintf_chk(dest, 0, __bos(dest), format,
                                    __builtin_va_arg_pack());
 }
@@ -207,7 +198,7 @@
 
 #if __ANDROID_API__ >= __ANDROID_API_N__
 __BIONIC_FORTIFY_INLINE
-size_t fread(void *__restrict buf, size_t size, size_t count, FILE * __restrict stream) {
+size_t fread(void* buf, size_t size, size_t count, FILE* stream) {
     size_t bos = __bos0(buf);
 
     if (bos == __BIONIC_FORTIFY_UNKNOWN_SIZE) {
@@ -231,7 +222,7 @@
 }
 
 __BIONIC_FORTIFY_INLINE
-size_t fwrite(const void * __restrict buf, size_t size, size_t count, FILE * __restrict stream) {
+size_t fwrite(const void* buf, size_t size, size_t count, FILE* stream) {
     size_t bos = __bos0(buf);
 
     if (bos == __BIONIC_FORTIFY_UNKNOWN_SIZE) {
diff --git a/libc/include/bits/fortify/string.h b/libc/include/bits/fortify/string.h
index 74e87a4..2fe48d4 100644
--- a/libc/include/bits/fortify/string.h
+++ b/libc/include/bits/fortify/string.h
@@ -32,12 +32,12 @@
 
 void* __memchr_chk(const void* _Nonnull, int, size_t, size_t) __INTRODUCED_IN(23);
 void* __memrchr_chk(const void* _Nonnull, int, size_t, size_t) __INTRODUCED_IN(23);
-char* __stpncpy_chk2(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t, size_t, size_t)
+char* __stpncpy_chk2(char* _Nonnull, const char* _Nonnull, size_t, size_t, size_t)
   __INTRODUCED_IN(21);
-char* __strncpy_chk2(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t, size_t, size_t)
+char* __strncpy_chk2(char* _Nonnull, const char* _Nonnull, size_t, size_t, size_t)
   __INTRODUCED_IN(21);
-size_t __strlcpy_chk(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t, size_t) __INTRODUCED_IN(17);
-size_t __strlcat_chk(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t, size_t) __INTRODUCED_IN(17);
+size_t __strlcpy_chk(char* _Nonnull, const char* _Nonnull, size_t, size_t) __INTRODUCED_IN(17);
+size_t __strlcat_chk(char* _Nonnull, const char* _Nonnull, size_t, size_t) __INTRODUCED_IN(17);
 
 /* Only used with FORTIFY, but some headers that need it undef FORTIFY, so we
  * have the definition out here.
@@ -49,7 +49,7 @@
 // trickery...
 #if __ANDROID_API__ >= __ANDROID_API_J_MR1__
 __BIONIC_FORTIFY_INLINE
-void* memcpy(void* _Nonnull __restrict const dst __pass_object_size0, const void* _Nonnull __restrict src, size_t copy_amount)
+void* memcpy(void* _Nonnull const dst __pass_object_size0, const void* _Nonnull  src, size_t copy_amount)
         __overloadable {
     return __builtin___memcpy_chk(dst, src, copy_amount, __bos0(dst));
 }
@@ -63,7 +63,7 @@
 
 #if __ANDROID_API__ >= __ANDROID_API_L__
 __BIONIC_FORTIFY_INLINE
-char* stpcpy(char* _Nonnull __restrict const dst __pass_object_size, const char* _Nonnull __restrict src)
+char* stpcpy(char* _Nonnull const dst __pass_object_size, const char* _Nonnull src)
         __overloadable {
     return __builtin___stpcpy_chk(dst, src, __bos(dst));
 }
@@ -71,19 +71,19 @@
 
 #if __ANDROID_API__ >= __ANDROID_API_J_MR1__
 __BIONIC_FORTIFY_INLINE
-char* strcpy(char* _Nonnull __restrict const dst __pass_object_size, const char* _Nonnull __restrict src)
+char* strcpy(char* _Nonnull const dst __pass_object_size, const char* _Nonnull src)
         __overloadable {
     return __builtin___strcpy_chk(dst, src, __bos(dst));
 }
 
 __BIONIC_FORTIFY_INLINE
-char* strcat(char* _Nonnull __restrict const dst __pass_object_size, const char* _Nonnull __restrict src)
+char* strcat(char* _Nonnull const dst __pass_object_size, const char* _Nonnull src)
         __overloadable {
     return __builtin___strcat_chk(dst, src, __bos(dst));
 }
 
 __BIONIC_FORTIFY_INLINE
-char* strncat(char* const _Nonnull __restrict dst __pass_object_size, const char* _Nonnull __restrict src, size_t n)
+char* strncat(char* const _Nonnull dst __pass_object_size, const char* _Nonnull src, size_t n)
         __overloadable {
     return __builtin___strncat_chk(dst, src, n, __bos(dst));
 }
@@ -154,7 +154,7 @@
 
 #if __ANDROID_API__ >= __ANDROID_API_L__
 __BIONIC_FORTIFY_INLINE
-char* stpncpy(char* __restrict const _Nonnull dst __pass_object_size, const char* __restrict const _Nonnull src __pass_object_size, size_t n)
+char* stpncpy(char* const _Nonnull dst __pass_object_size, const char* const _Nonnull src __pass_object_size, size_t n)
         __overloadable {
     size_t bos_dst = __bos(dst);
     size_t bos_src = __bos(src);
@@ -168,7 +168,7 @@
 }
 
 __BIONIC_FORTIFY_INLINE
-char* strncpy(char* __restrict const _Nonnull dst __pass_object_size, const char* __restrict const _Nonnull src __pass_object_size, size_t n)
+char* strncpy(char* const _Nonnull dst __pass_object_size, const char* const _Nonnull src __pass_object_size, size_t n)
         __overloadable {
     size_t bos_dst = __bos(dst);
     size_t bos_src = __bos(src);
@@ -184,7 +184,7 @@
 
 #if __ANDROID_API__ >= __ANDROID_API_J_MR1__
 __BIONIC_FORTIFY_INLINE
-size_t strlcpy(char* const _Nonnull __restrict dst __pass_object_size, const char *_Nonnull __restrict src, size_t size)
+size_t strlcpy(char* const _Nonnull dst __pass_object_size, const char *_Nonnull src, size_t size)
         __overloadable {
     size_t bos = __bos(dst);
 
@@ -196,7 +196,7 @@
 }
 
 __BIONIC_FORTIFY_INLINE
-size_t strlcat(char* const _Nonnull __restrict dst __pass_object_size, const char* _Nonnull __restrict src, size_t size)
+size_t strlcat(char* const _Nonnull dst __pass_object_size, const char* _Nonnull src, size_t size)
         __overloadable {
     size_t bos = __bos(dst);
 
@@ -293,11 +293,11 @@
 #undef __error_zero_size
 #undef __error_if_overflows_dst
 #else // defined(__clang__)
-extern char* __strncpy_real(char* __restrict, const char*, size_t) __RENAME(strncpy);
+extern char* __strncpy_real(char*, const char*, size_t) __RENAME(strncpy);
 extern void* __memrchr_real(const void*, int, size_t) __RENAME(memrchr);
-extern size_t __strlcpy_real(char* __restrict, const char* __restrict, size_t)
+extern size_t __strlcpy_real(char*, const char*, size_t)
     __RENAME(strlcpy);
-extern size_t __strlcat_real(char* __restrict, const char* __restrict, size_t)
+extern size_t __strlcat_real(char*, const char*, size_t)
     __RENAME(strlcat);
 
 __errordecl(__memchr_buf_size_error, "memchr called with size bigger than buffer");
@@ -345,7 +345,7 @@
 
 #if __ANDROID_API__ >= __ANDROID_API_L__
 __BIONIC_FORTIFY_INLINE
-char* stpncpy(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src, size_t n) {
+char* stpncpy(char* _Nonnull dst, const char* _Nonnull src, size_t n) {
     size_t bos_dst = __bos(dst);
     size_t bos_src = __bos(src);
 
@@ -366,7 +366,7 @@
 }
 
 __BIONIC_FORTIFY_INLINE
-char* strncpy(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src, size_t n) {
+char* strncpy(char* _Nonnull dst, const char* _Nonnull src, size_t n) {
     size_t bos_dst = __bos(dst);
     size_t bos_src = __bos(src);
 
@@ -389,7 +389,7 @@
 
 #if __ANDROID_API__ >= __ANDROID_API_J_MR1__
 __BIONIC_FORTIFY_INLINE
-size_t strlcpy(char* _Nonnull __restrict dst __pass_object_size, const char* _Nonnull __restrict src, size_t size) {
+size_t strlcpy(char* _Nonnull dst __pass_object_size, const char* _Nonnull src, size_t size) {
     size_t bos = __bos(dst);
 
     // Compiler doesn't know destination size. Don't call __strlcpy_chk
@@ -407,7 +407,7 @@
 }
 
 __BIONIC_FORTIFY_INLINE
-size_t strlcat(char* _Nonnull __restrict dst, const char* _Nonnull __restrict src, size_t size) {
+size_t strlcat(char* _Nonnull dst, const char* _Nonnull src, size_t size) {
     size_t bos = __bos(dst);
 
     // Compiler doesn't know destination size. Don't call __strlcat_chk
diff --git a/libc/include/inttypes.h b/libc/include/inttypes.h
index f74afa3..43474df 100644
--- a/libc/include/inttypes.h
+++ b/libc/include/inttypes.h
@@ -257,10 +257,10 @@
 __BEGIN_DECLS
 intmax_t imaxabs(intmax_t) __attribute_const__ __INTRODUCED_IN(19);
 imaxdiv_t imaxdiv(intmax_t, intmax_t) __attribute_const__ __INTRODUCED_IN(19);
-intmax_t	strtoimax(const char *, char **, int);
-uintmax_t	strtoumax(const char *, char **, int);
-intmax_t wcstoimax(const wchar_t* __restrict, wchar_t** __restrict, int) __INTRODUCED_IN(21);
-uintmax_t wcstoumax(const wchar_t* __restrict, wchar_t** __restrict, int) __INTRODUCED_IN(21);
+intmax_t strtoimax(const char*, char**, int);
+uintmax_t strtoumax(const char*, char**, int);
+intmax_t wcstoimax(const wchar_t*, wchar_t**, int) __INTRODUCED_IN(21);
+uintmax_t wcstoumax(const wchar_t*, wchar_t**, int) __INTRODUCED_IN(21);
 __END_DECLS
 
 #endif /* _INTTYPES_H_ */
diff --git a/libc/include/search.h b/libc/include/search.h
index dc160e9..46998d9 100644
--- a/libc/include/search.h
+++ b/libc/include/search.h
@@ -37,7 +37,7 @@
 void* lsearch(const void*, void*, size_t*, size_t, int (*)(const void*, const void*))
   __INTRODUCED_IN(21);
 
-void* tdelete(const void* __restrict, void** __restrict, int (*)(const void*, const void*))
+void* tdelete(const void*, void**, int (*)(const void*, const void*))
   __INTRODUCED_IN(16);
 void tdestroy(void*, void (*)(void*)) __INTRODUCED_IN(16);
 void* tfind(const void*, void* const*, int (*)(const void*, const void*)) __INTRODUCED_IN(16);
diff --git a/libc/include/stdio.h b/libc/include/stdio.h
index 7f0d67e..2ac1686 100644
--- a/libc/include/stdio.h
+++ b/libc/include/stdio.h
@@ -121,39 +121,39 @@
 int	 ferror(FILE *);
 int	 fflush(FILE *);
 int	 fgetc(FILE *);
-char	*fgets(char * __restrict, int, FILE * __restrict) __overloadable
+char	*fgets(char *, int, FILE *) __overloadable
   __RENAME_CLANG(fgets);
-int	 fprintf(FILE * __restrict , const char * __restrict _Nonnull, ...) __printflike(2, 3);
+int	 fprintf(FILE * , const char * _Nonnull, ...) __printflike(2, 3);
 int	 fputc(int, FILE *);
-int	 fputs(const char * __restrict, FILE * __restrict);
-size_t	 fread(void * __restrict, size_t, size_t, FILE * __restrict)
+int	 fputs(const char *, FILE *);
+size_t	 fread(void *, size_t, size_t, FILE *)
       __overloadable __RENAME_CLANG(fread);
-int	 fscanf(FILE * __restrict, const char * __restrict _Nonnull, ...) __scanflike(2, 3);
-size_t	 fwrite(const void * __restrict, size_t, size_t, FILE * __restrict)
+int	 fscanf(FILE *, const char * _Nonnull, ...) __scanflike(2, 3);
+size_t	 fwrite(const void *, size_t, size_t, FILE *)
     __overloadable __RENAME_CLANG(fwrite);
 int	 getc(FILE *);
 int	 getchar(void);
-ssize_t getdelim(char** __restrict, size_t* __restrict, int, FILE* __restrict) __INTRODUCED_IN(18);
-ssize_t getline(char** __restrict, size_t* __restrict, FILE* __restrict) __INTRODUCED_IN(18);
+ssize_t getdelim(char**, size_t*, int, FILE*) __INTRODUCED_IN(18);
+ssize_t getline(char**, size_t*, FILE*) __INTRODUCED_IN(18);
 
 void	 perror(const char *);
-int	 printf(const char * __restrict _Nonnull, ...) __printflike(1, 2);
+int	 printf(const char * _Nonnull, ...) __printflike(1, 2);
 int	 putc(int, FILE *);
 int	 putchar(int);
 int	 puts(const char *);
 int	 remove(const char *);
 void	 rewind(FILE *);
-int	 scanf(const char * __restrict _Nonnull, ...) __scanflike(1, 2);
-void	 setbuf(FILE * __restrict, char * __restrict);
-int	 setvbuf(FILE * __restrict, char * __restrict, int, size_t);
-int	 sscanf(const char * __restrict, const char * __restrict _Nonnull, ...) __scanflike(2, 3);
+int	 scanf(const char * _Nonnull, ...) __scanflike(1, 2);
+void	 setbuf(FILE *, char *);
+int	 setvbuf(FILE *, char *, int, size_t);
+int	 sscanf(const char *, const char * _Nonnull, ...) __scanflike(2, 3);
 int	 ungetc(int, FILE *);
-int	 vfprintf(FILE * __restrict, const char * __restrict _Nonnull, __va_list) __printflike(2, 0);
-int	 vprintf(const char * __restrict _Nonnull, __va_list) __printflike(1, 0);
+int	 vfprintf(FILE *, const char * _Nonnull, __va_list) __printflike(2, 0);
+int	 vprintf(const char * _Nonnull, __va_list) __printflike(1, 0);
 
 #if __ANDROID_API__ >= 21
-int dprintf(int, const char* __restrict _Nonnull, ...) __printflike(2, 3) __INTRODUCED_IN(21);
-int vdprintf(int, const char* __restrict _Nonnull, __va_list) __printflike(2, 0) __INTRODUCED_IN(21);
+int dprintf(int, const char* _Nonnull, ...) __printflike(2, 3) __INTRODUCED_IN(21);
+int vdprintf(int, const char* _Nonnull, __va_list) __printflike(2, 0) __INTRODUCED_IN(21);
 #else
 /*
  * Old versions of Android called these fdprintf and vfdprintf out of fears that the glibc names
@@ -162,18 +162,18 @@
  * Allow users to just use dprintf and vfdprintf on any version by renaming those calls to their
  * legacy equivalents if needed.
  */
-int dprintf(int, const char* __restrict _Nonnull, ...) __printflike(2, 3) __RENAME(fdprintf);
-int vdprintf(int, const char* __restrict _Nonnull, __va_list) __printflike(2, 0) __RENAME(vfdprintf);
+int dprintf(int, const char* _Nonnull, ...) __printflike(2, 3) __RENAME(fdprintf);
+int vdprintf(int, const char* _Nonnull, __va_list) __printflike(2, 0) __RENAME(vfdprintf);
 #endif
 
 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ < 201112L) || \
     (defined(__cplusplus) && __cplusplus <= 201103L)
 char* gets(char*) __attribute__((deprecated("gets is unsafe, use fgets instead")));
 #endif
-int sprintf(char* __restrict, const char* __restrict _Nonnull, ...)
+int sprintf(char*, const char* _Nonnull, ...)
     __printflike(2, 3) __warnattr_strict("sprintf is often misused; please use snprintf")
     __overloadable __RENAME_CLANG(sprintf);
-int vsprintf(char* __restrict, const char* __restrict _Nonnull, __va_list)
+int vsprintf(char*, const char* _Nonnull, __va_list)
     __overloadable __printflike(2, 0) __RENAME_CLANG(vsprintf)
     __warnattr_strict("vsprintf is often misused; please use vsnprintf");
 char* tmpnam(char*)
@@ -222,21 +222,21 @@
                 fpos64_t (*)(void*, fpos64_t, int), int (*)(void*)) __INTRODUCED_IN(24);
 #endif
 
-FILE* fopen(const char* __restrict, const char* __restrict);
-FILE* fopen64(const char* __restrict, const char* __restrict) __INTRODUCED_IN(24);
-FILE* freopen(const char* __restrict, const char* __restrict, FILE* __restrict);
-FILE* freopen64(const char* __restrict, const char* __restrict, FILE* __restrict)
+FILE* fopen(const char*, const char*);
+FILE* fopen64(const char*, const char*) __INTRODUCED_IN(24);
+FILE* freopen(const char*, const char*, FILE*);
+FILE* freopen64(const char*, const char*, FILE*)
   __INTRODUCED_IN(24);
 FILE* tmpfile(void);
 FILE* tmpfile64(void) __INTRODUCED_IN(24);
 
-int snprintf(char* __restrict, size_t, const char* __restrict _Nonnull, ...)
+int snprintf(char*, size_t, const char* _Nonnull, ...)
     __printflike(3, 4) __overloadable __RENAME_CLANG(snprintf);
-int vfscanf(FILE* __restrict, const char* __restrict _Nonnull, __va_list) __scanflike(2, 0);
+int vfscanf(FILE*, const char* _Nonnull, __va_list) __scanflike(2, 0);
 int vscanf(const char* _Nonnull , __va_list) __scanflike(1, 0);
-int vsnprintf(char* __restrict, size_t, const char* __restrict _Nonnull, __va_list)
+int vsnprintf(char*, size_t, const char* _Nonnull, __va_list)
     __printflike(3, 0) __overloadable __RENAME_CLANG(vsnprintf);
-int vsscanf(const char* __restrict _Nonnull, const char* __restrict _Nonnull, __va_list) __scanflike(2, 0);
+int vsscanf(const char* _Nonnull, const char* _Nonnull, __va_list) __scanflike(2, 0);
 
 #define L_ctermid 1024 /* size for ctermid() */
 char* ctermid(char*) __INTRODUCED_IN(26);
@@ -257,12 +257,12 @@
 FILE* open_memstream(char**, size_t*) __INTRODUCED_IN(23);
 
 #if defined(__USE_BSD) || defined(__BIONIC__) /* Historically bionic exposed these. */
-int  asprintf(char** __restrict, const char* __restrict _Nonnull, ...) __printflike(2, 3);
-char* fgetln(FILE* __restrict, size_t* __restrict);
+int  asprintf(char**, const char* _Nonnull, ...) __printflike(2, 3);
+char* fgetln(FILE*, size_t*);
 int fpurge(FILE*);
 void setbuffer(FILE*, char*, int);
 int setlinebuf(FILE*);
-int vasprintf(char** __restrict, const char* __restrict _Nonnull, __va_list) __printflike(2, 0);
+int vasprintf(char**, const char* _Nonnull, __va_list) __printflike(2, 0);
 void clearerr_unlocked(FILE*) __INTRODUCED_IN(23);
 int feof_unlocked(FILE*) __INTRODUCED_IN(23);
 int ferror_unlocked(FILE*) __INTRODUCED_IN(23);
diff --git a/libc/include/string.h b/libc/include/string.h
index 81eaccf..8b4fa27 100644
--- a/libc/include/string.h
+++ b/libc/include/string.h
@@ -46,16 +46,16 @@
 #include <strings.h>
 #endif
 
-void* memccpy(void* _Nonnull __restrict, const void* _Nonnull __restrict, int, size_t);
+void* memccpy(void* _Nonnull, const void* _Nonnull, int, size_t);
 void* memchr(const void* _Nonnull, int, size_t) __attribute_pure__ __overloadable
         __RENAME_CLANG(memchr);
 void* memrchr(const void* _Nonnull, int, size_t) __attribute_pure__ __overloadable
         __RENAME_CLANG(memrchr);
 int memcmp(const void* _Nonnull, const void* _Nonnull, size_t) __attribute_pure__;
-void* memcpy(void* _Nonnull __restrict, const void* _Nonnull __restrict, size_t)
+void* memcpy(void* _Nonnull, const void* _Nonnull, size_t)
         __overloadable __RENAME_CLANG(memcpy);
 #if defined(__USE_GNU)
-void* mempcpy(void* _Nonnull __restrict, const void* _Nonnull __restrict, size_t) __INTRODUCED_IN(23);
+void* mempcpy(void* _Nonnull, const void* _Nonnull, size_t) __INTRODUCED_IN(23);
 #endif
 void* memmove(void* _Nonnull, const void* _Nonnull, size_t) __overloadable
         __RENAME_CLANG(memmove);
@@ -83,18 +83,18 @@
 size_t __strlen_chk(const char* _Nonnull, size_t) __INTRODUCED_IN(17);
 
 int strcmp(const char* _Nonnull, const char* _Nonnull) __attribute_pure__;
-char* stpcpy(char* _Nonnull __restrict, const char* _Nonnull __restrict)
+char* stpcpy(char* _Nonnull, const char* _Nonnull)
         __overloadable __RENAME_CLANG(stpcpy) __INTRODUCED_IN(21);
-char* strcpy(char* _Nonnull __restrict, const char* _Nonnull __restrict)
+char* strcpy(char* _Nonnull, const char* _Nonnull)
         __overloadable __RENAME_CLANG(strcpy);
-char* strcat(char* _Nonnull __restrict, const char* _Nonnull __restrict)
+char* strcat(char* _Nonnull, const char* _Nonnull)
         __overloadable __RENAME_CLANG(strcat);
 char* strdup(const char* _Nonnull);
 
 char* strstr(const char* _Nonnull, const char* _Nonnull) __attribute_pure__;
 char* strcasestr(const char* _Nonnull, const char* _Nonnull) __attribute_pure__;
-char* strtok(char* __restrict, const char* _Nonnull __restrict);
-char* strtok_r(char* __restrict, const char* _Nonnull __restrict, char** _Nonnull __restrict);
+char* strtok(char*, const char* _Nonnull);
+char* strtok_r(char*, const char* _Nonnull, char** _Nonnull);
 
 char* strerror(int);
 char* strerror_l(int, locale_t) __INTRODUCED_IN(23);
@@ -105,33 +105,33 @@
 #endif
 
 size_t strnlen(const char* _Nonnull, size_t) __attribute_pure__;
-char* strncat(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t)
+char* strncat(char* _Nonnull, const char* _Nonnull, size_t)
         __overloadable __RENAME_CLANG(strncat);
 char* strndup(const char* _Nonnull, size_t);
 int strncmp(const char* _Nonnull, const char* _Nonnull, size_t) __attribute_pure__;
-char* stpncpy(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t)
+char* stpncpy(char* _Nonnull, const char* _Nonnull, size_t)
         __overloadable __RENAME_CLANG(stpncpy) __INTRODUCED_IN(21);
-char* strncpy(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t)
+char* strncpy(char* _Nonnull, const char* _Nonnull, size_t)
         __overloadable __RENAME_CLANG(strncpy);
 
-size_t strlcat(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t)
+size_t strlcat(char* _Nonnull, const char* _Nonnull, size_t)
         __overloadable __RENAME_CLANG(strlcat);
-size_t strlcpy(char* _Nonnull __restrict, const char* _Nonnull __restrict, size_t)
+size_t strlcpy(char* _Nonnull, const char* _Nonnull, size_t)
         __overloadable __RENAME_CLANG(strlcpy);
 
 size_t strcspn(const char* _Nonnull, const char* _Nonnull) __attribute_pure__;
 char* strpbrk(const char* _Nonnull, const char* _Nonnull) __attribute_pure__;
-char* strsep(char** _Nonnull __restrict, const char* _Nonnull __restrict);
+char* strsep(char** _Nonnull, const char* _Nonnull);
 size_t strspn(const char* _Nonnull, const char* _Nonnull);
 
 char* strsignal(int);
 
 int strcoll(const char* _Nonnull, const char* _Nonnull) __attribute_pure__;
-size_t strxfrm(char* __restrict, const char* _Nonnull __restrict, size_t);
+size_t strxfrm(char*, const char* _Nonnull, size_t);
 
 #if __ANDROID_API__ >= __ANDROID_API_L__
 int strcoll_l(const char* _Nonnull, const char* _Nonnull, locale_t) __attribute_pure__ __INTRODUCED_IN(21);
-size_t strxfrm_l(char* __restrict, const char* _Nonnull __restrict, size_t, locale_t) __INTRODUCED_IN(21);
+size_t strxfrm_l(char*, const char* _Nonnull, size_t, locale_t) __INTRODUCED_IN(21);
 #else
 // Implemented as static inlines before 21.
 #endif
diff --git a/libc/include/sys/statvfs.h b/libc/include/sys/statvfs.h
index af1b9c0..5df4160 100644
--- a/libc/include/sys/statvfs.h
+++ b/libc/include/sys/statvfs.h
@@ -59,10 +59,8 @@
 #define ST_NODIRATIME  0x0800
 #define ST_RELATIME    0x1000
 
-int statvfs(const char* __restrict _Nonnull, struct statvfs* __restrict _Nonnull)
-  __INTRODUCED_IN(19);
-int statvfs64(const char* __restrict _Nonnull, struct statvfs64* __restrict _Nonnull)
-  __INTRODUCED_IN(21);
+int statvfs(const char* _Nonnull, struct statvfs* _Nonnull) __INTRODUCED_IN(19);
+int statvfs64(const char* _Nonnull, struct statvfs64* _Nonnull) __INTRODUCED_IN(21);
 int fstatvfs(int, struct statvfs* _Nonnull) __INTRODUCED_IN(19);
 int fstatvfs64(int, struct statvfs64* _Nonnull) __INTRODUCED_IN(21);
 
diff --git a/libc/include/uchar.h b/libc/include/uchar.h
index 818acb1..ac0cf1d 100644
--- a/libc/include/uchar.h
+++ b/libc/include/uchar.h
@@ -43,12 +43,10 @@
 #define __STD_UTF_16__ 1
 #define __STD_UTF_32__ 1
 
-size_t c16rtomb(char* __restrict, char16_t, mbstate_t* __restrict) __INTRODUCED_IN(21);
-size_t c32rtomb(char* __restrict, char32_t, mbstate_t* __restrict) __INTRODUCED_IN(21);
-size_t mbrtoc16(char16_t* __restrict, const char* __restrict, size_t, mbstate_t* __restrict)
-  __INTRODUCED_IN(21);
-size_t mbrtoc32(char32_t* __restrict, const char* __restrict, size_t, mbstate_t* __restrict)
-  __INTRODUCED_IN(21);
+size_t c16rtomb(char*, char16_t, mbstate_t*) __INTRODUCED_IN(21);
+size_t c32rtomb(char*, char32_t, mbstate_t*) __INTRODUCED_IN(21);
+size_t mbrtoc16(char16_t*, const char*, size_t, mbstate_t*) __INTRODUCED_IN(21);
+size_t mbrtoc32(char32_t*, const char*, size_t, mbstate_t*) __INTRODUCED_IN(21);
 
 __END_DECLS
 
diff --git a/libc/stdio/local.h b/libc/stdio/local.h
index afb02ca..1697116 100644
--- a/libc/stdio/local.h
+++ b/libc/stdio/local.h
@@ -202,9 +202,9 @@
 wint_t __fgetwc_unlock(FILE *);
 wint_t	__ungetwc(wint_t, FILE *);
 int	__vfprintf(FILE *, const char *, __va_list);
-int	__svfscanf(FILE * __restrict, const char * __restrict, __va_list);
-int	__vfwprintf(FILE * __restrict, const wchar_t * __restrict, __va_list);
-int	__vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list);
+int	__svfscanf(FILE *, const char *, __va_list);
+int	__vfwprintf(FILE *, const wchar_t *, __va_list);
+int	__vfwscanf(FILE *, const wchar_t *, __va_list);
 
 /*
  * Return true if the given FILE cannot be written now.