[PATCH] powerpc: Fix compiler warning on some syscalls
Andreas Schwab
schwab@linux-m68k.org
Tue Jan 6 14:29:00 GMT 2015
Adhemerval Zanella <azanella@linux.vnet.ibm.com> writes:
> diff --git a/sysdeps/unix/sysv/linux/futimesat.c b/sysdeps/unix/sysv/linux/futimesat.c
> index ac96e2a..f7d5645 100644
> --- a/sysdeps/unix/sysv/linux/futimesat.c
> +++ b/sysdeps/unix/sysv/linux/futimesat.c
> @@ -28,13 +28,13 @@
> /* Change the access time of FILE relative to FD to TVP[0] and
> the modification time of FILE to TVP[1]. */
> int
> -futimesat (fd, file, tvp)
> - int fd;
> - const char *file;
> - const struct timeval tvp[2];
> +futimesat (int fd, const char *file, const struct timeval tvp[2])
> {
> if (file == NULL)
> return __futimes (fd, tvp);
>
> - return INLINE_SYSCALL (futimesat, 3, fd, file, tvp);
> + /* Some archs (powerpc) add arguments type and size check using sizeof
> + and without a cast the compiler might emit an warning about using
> + sizeof on a struct (where the builtin returns the pointer size). */
> + return INLINE_SYSCALL (futimesat, 3, fd, file, (const struct timeval*)tvp);
Does &tvp[0] work instead?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
More information about the Libc-alpha
mailing list