This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] powerpc: Fix compiler warning on some syscalls


On 06-01-2015 12:29, Andreas Schwab wrote:
> 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.
>
It does and I think using would not require an explicit comment about it
usage.  Would it be a preferable solution?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]