Merge "Clean up the area of pthread key destruction." into main
diff --git a/libc/include/bits/fortify/string.h b/libc/include/bits/fortify/string.h
index 6f0ee4a..0b4b70b 100644
--- a/libc/include/bits/fortify/string.h
+++ b/libc/include/bits/fortify/string.h
@@ -42,7 +42,6 @@
 size_t __strlcat_chk(char* _Nonnull, const char* _Nonnull, size_t, size_t);
 
 #if defined(__BIONIC_FORTIFY)
-void* _Nullable __memrchr_real(const void* _Nonnull, int, size_t) __RENAME(memrchr);
 
 #if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
 /* No diag -- clang diagnoses misuses of this on its own.  */
@@ -153,6 +152,8 @@
     return __memchr_chk(s, c, n, bos);
 }
 
+void* _Nullable __memrchr_real(const void* _Nonnull, int, size_t) __RENAME(memrchr);
+
 __BIONIC_FORTIFY_INLINE
 void* _Nullable __memrchr_fortify(const void* _Nonnull const __pass_object_size s, int c, size_t n) __overloadable {
     size_t bos = __bos(s);
diff --git a/tests/pty_test.cpp b/tests/pty_test.cpp
index d5d8994..6e3d2c7 100644
--- a/tests/pty_test.cpp
+++ b/tests/pty_test.cpp
@@ -103,6 +103,8 @@
   arg->finished = true;
 }
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
 TEST(pty, bug_28979140) {
   // This test is to test a kernel bug, which uses a lock free ring-buffer to
   // pass data through a raw pty, but missing necessary memory barriers.
@@ -164,3 +166,4 @@
   ASSERT_TRUE(arg.matched);
   close(pty);
 }
+#pragma clang diagnostic pop
\ No newline at end of file
diff --git a/tests/stdio_ext_test.cpp b/tests/stdio_ext_test.cpp
index dce1a66..56483f5 100644
--- a/tests/stdio_ext_test.cpp
+++ b/tests/stdio_ext_test.cpp
@@ -241,6 +241,8 @@
   funlockfile(stdout);
 }
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
 TEST(stdio_ext, __fsetlocking_BYCALLER) {
   // Check if users can use flockfile/funlockfile to protect stdio operations.
   int old_state = __fsetlocking(stdout, FSETLOCKING_BYCALLER);
@@ -255,3 +257,4 @@
   ASSERT_EQ(0, pthread_join(thread, nullptr));
   __fsetlocking(stdout, old_state);
 }
+#pragma clang diagnostic pop