From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id D3A70385829E; Wed, 7 Feb 2024 14:13:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3A70385829E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707315198; bh=BiDOHczz6z4jEWfdnEBBOBjTafkZxWwmGTUo4uSmvQU=; h=From:To:Subject:Date:From; b=oh6FUJvtZcmGSamj4kymsWBpAm/hqVliSzAjABmmAZ59H9D0W1GKAFJgonWRNo/7g D46QcH4y+vYSTUOlFqv5is6DFOF4gntrRdTkqXJGIRxJJg/N4xokxU3KafJdJWanYO 3Cv/WRwuZ/EvKLp9KlwNB2Zcya87kIhJ2yHe++JA= 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: 947f7d8baca824bf14bd4486a3280316261f687a X-Git-Newrev: eec55cbe0a53823d5a483b82f5779567cea6f2d3 Message-Id: <20240207141318.D3A70385829E@sourceware.org> Date: Wed, 7 Feb 2024 14:13:18 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=eec55cbe0a53823d5a483b82f5779567cea6f2d3 commit eec55cbe0a53823d5a483b82f5779567cea6f2d3 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 7ab147c614..11d6173ff1 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); }