From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 09D223858422; Fri, 28 Oct 2022 17:47:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09D223858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666979261; bh=JqoxK9pn6eqJRGtZ8pf+DpKFMUSVfF4Hz7lXEzPOuok=; h=From:To:Subject:Date:From; b=pEAImXAXSyXAjyOdHMgPtlUdPI7YRYPENu/eJ6nnfTYR+PieCVo73w1HjLsqiJqqg TGYn2IMJBQ3FRNo9dULmx87wskOh+Zp/4asQKxOo9Sg3qpIpomxn2pF2eX8S26h7Td JxgTD5dHKb4oUfix/+hghV4Jbi+LNIHy2ND06190= 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: 7df701fcde065130ca68f3e75398674b3d62a7f1 X-Git-Newrev: 460a98231b13e31b888bd8d4d5abd28dad3c44d7 Message-Id: <20221028174741.09D223858422@sourceware.org> Date: Fri, 28 Oct 2022 17:47:40 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=460a98231b13e31b888bd8d4d5abd28dad3c44d7 commit 460a98231b13e31b888bd8d4d5abd28dad3c44d7 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 494065adfb..9dab97f4ef 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); }