From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 844FD3858033; Thu, 9 Feb 2023 19:54:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 844FD3858033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675972469; bh=2p1nNiq/JchUiqQyZUqDTYUPbeSdtzGoY2v0q8NPdPM=; h=From:To:Subject:Date:From; b=aay1YxZatY8R0l7pKIFagdW+9yU4uBga6bT0JaRlmY1X7acxtYGOsMp7YGiKQqz7s w9Tr5nVtX2hkrVIPIle0qMtHp0a9LF4/diGuDq+W1LG1oz6YZwS783S8d0JXGVwIIi iEeJKuKjGE/RH5+V02Wa86f2ogqtValficE8sV4A= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] linux: Avoid indirection on operand of type 'void *' for gettimeofday X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 1dc5cfbd03fef9bd5e571e19f32c6bc1025dc8b8 X-Git-Newrev: 9c4b4c1a0a441dcbef1ca825a7d509d7ee0e2f77 Message-Id: <20230209195429.844FD3858033@sourceware.org> Date: Thu, 9 Feb 2023 19:54:29 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9c4b4c1a0a441dcbef1ca825a7d509d7ee0e2f77 commit 9c4b4c1a0a441dcbef1ca825a7d509d7ee0e2f77 Author: Adhemerval Zanella Date: Mon Sep 26 10:00:51 2022 -0300 linux: Avoid indirection on operand of type 'void *' for gettimeofday ISO C does not allow and it fixes a clang issue with -Werror,-Wvoid-ptr-dereference. Checked on x86_64-linux-gnu. Diff: --- sysdeps/unix/sysv/linux/gettimeofday.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/gettimeofday.c b/sysdeps/unix/sysv/linux/gettimeofday.c index d3afd1a587..0f92b50f82 100644 --- a/sysdeps/unix/sysv/linux/gettimeofday.c +++ b/sysdeps/unix/sysv/linux/gettimeofday.c @@ -32,7 +32,7 @@ static int __gettimeofday_syscall (struct timeval *restrict tv, void *restrict tz) { if (__glibc_unlikely (tz != 0)) - memset (tz, 0, sizeof *tz); + memset (tz, 0, sizeof (struct timezone)); return INLINE_SYSCALL_CALL (gettimeofday, tv, tz); } @@ -48,7 +48,7 @@ int __gettimeofday (struct timeval *restrict tv, void *restrict tz) { if (__glibc_unlikely (tz != 0)) - memset (tz, 0, sizeof *tz); + memset (tz, 0, sizeof (struct timezone)); return INLINE_VSYSCALL (gettimeofday, 2, tv, tz); }