From 4f39d8167e9a5b9270d777bb932353e8e0724c9f Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 30 Aug 2022 09:39:25 +0000 Subject: Bug 1784193 - Cast values when setting _md_iovector._{f,}stat64 on Android API < 21. r=kaie Android API < 21 didn't have fstat64 or stat64 definitions, but it did have definitions for `struct stat64` that, while being a separate struct, is identical to `struct stat`. The signature for fstat and stat are thus valid, but the compiler can't say. Clang recently added a warning for incompatible function pointers, and it trips on using fstat and stat because of this. Differential Revision: https://phabricator.services.mozilla.com/D154336 --- pr/src/md/unix/unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pr/src/md/unix/unix.c b/pr/src/md/unix/unix.c index f71d1f66..70bb8e87 100644 --- a/pr/src/md/unix/unix.c +++ b/pr/src/md/unix/unix.c @@ -2755,8 +2755,8 @@ static void _PR_InitIOV(void) _md_iovector._mmap64 = mmap64; #if (defined(ANDROID) && __ANDROID_API__ < 21) /* Same as the open64 case for Android. */ - _md_iovector._fstat64 = fstat; - _md_iovector._stat64 = stat; + _md_iovector._fstat64 = (_MD_Fstat64)fstat; + _md_iovector._stat64 = (_MD_Stat64)stat; #else _md_iovector._fstat64 = fstat64; _md_iovector._stat64 = stat64; -- cgit v1.2.1