This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] powerpc: Fix compiler warning on some syscalls
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Tue, 06 Jan 2015 15:29:04 +0100
- Subject: Re: [PATCH] powerpc: Fix compiler warning on some syscalls
- Authentication-results: sourceware.org; auth=none
- References: <54ABDECE dot 3030306 at linux dot vnet dot ibm dot com>
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."