From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 4962A385803D; Tue, 4 Oct 2022 13:05:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4962A385803D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664888726; bh=BnJUZwXK+W1KpR+mWm9dCc9rklF/YZF9xQWhOb61XHg=; h=From:To:Subject:Date:From; b=ezOWyCtydG5qe31HrMDdySwiQmQtgAMDaOxC6YUUaNkd0tT6HwA6r/ViTtzZBlbfb 2Spn1R1pgbCrWSxbTDyayxbIvZeV79ABWgD5EsdP314Akj8ITYjpesWmmTtBKTHTM0 u8nIjsgHz48AryaWz48hswlzt5I6O78glC65WXPE= 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: e6451fd8cf6a78eac79b1df6076d70d79cb9e74b X-Git-Newrev: fe1ad8d6860717ed0fd554b8473b0c84a8210c77 Message-Id: <20221004130526.4962A385803D@sourceware.org> Date: Tue, 4 Oct 2022 13:05:26 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fe1ad8d6860717ed0fd554b8473b0c84a8210c77 commit fe1ad8d6860717ed0fd554b8473b0c84a8210c77 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); }