diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-09-26 10:00:51 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-02-09 10:29:18 -0300 |
commit | 3420e9ac354235757862f685018a86e1315d662e (patch) | |
tree | 06e435cf2be1b2a95499685f9e1f93166193367b | |
parent | 9b89aa6b5863351af361fe960a80edd5d584bf9e (diff) | |
download | glibc-3420e9ac354235757862f685018a86e1315d662e.tar glibc-3420e9ac354235757862f685018a86e1315d662e.tar.gz glibc-3420e9ac354235757862f685018a86e1315d662e.tar.bz2 glibc-3420e9ac354235757862f685018a86e1315d662e.zip |
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.
-rw-r--r-- | sysdeps/unix/sysv/linux/gettimeofday.c | 4 |
1 files 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); } |