From patchwork Tue Jan 6 17:06:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 425747 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id DA1041400A0 for ; Wed, 7 Jan 2015 04:06:40 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=HIfEczIXb++5T7A27n/L8H8vyqVkULzdOSTOc99GV/v Fs4pswA+HN4Dhkm6ZnEInOqbQPVhtemGsNJjIl/dETEQAy78akc7Hv9UyYBfTzzv xHubR7MXn78wAy8E02D1zNyRFfCI30qycZv+E6oFG/K+6W50bCm3zz0AsSi4l88o = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=hk+jH5DcJoMfCX93Xrp1iwiUcIs=; b=oI0Xy+mDXfQyOaneE 7fyEfhhJ+8vrMQ0VTdlye3L5OsEwdCcZELBfo7UCo8TifCKxcaUYfABoNUg0O7oU oMH9KioQsu0wRSgYjy8GxEDcWs1YpcvIXf8diLgKP+gqB27wERAvsaI8hO/76UXn Pi3d/19x5QofnzzPu1+JznEul0= Received: (qmail 7883 invoked by alias); 6 Jan 2015 17:06:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 7862 invoked by uid 89); 6 Jan 2015 17:06:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e24smtp04.br.ibm.com Message-ID: <54AC160F.6030403@linux.vnet.ibm.com> Date: Tue, 06 Jan 2015 15:06:23 -0200 From: Adhemerval Zanella User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: libc-alpha@sourceware.org Subject: Re: [PATCH] powerpc: Fix compiler warning on some syscalls References: <54ABDECE.3030306@linux.vnet.ibm.com> <87387ot233.fsf@igel.home> <54ABFAD6.8020008@linux.vnet.ibm.com> <54AC0560.60707@cs.ucla.edu> In-Reply-To: <54AC0560.60707@cs.ucla.edu> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15010617-0029-0000-0000-00000279A3F5 On 06-01-2015 13:55, Paul Eggert wrote: > On 01/06/2015 07:10 AM, Adhemerval Zanella wrote: >>> 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? >> > > Absolutely. Casts are too powerful and can get one into trouble too easily. > Fair enough, is it ok now for push? --- * sysdeps/unix/sysv/linux/futimens.c (futimens): Use address of first timespec struct member in syscall macro. * sysdeps/unix/sysv/linux/utimensat.c (utimensat): Likewise. * sysdeps/unix/sysv/linux/futimesat.c (futimesat): Use address of first timeval struct member in syscall macro. * sysdeps/unix/sysv/linux/utimes.c (__utimeS): Likewise. -- diff --git a/sysdeps/unix/sysv/linux/futimens.c b/sysdeps/unix/sysv/linux/futimens.c index c7d03a8..1dda738f 100644 --- a/sysdeps/unix/sysv/linux/futimens.c +++ b/sysdeps/unix/sysv/linux/futimens.c @@ -37,7 +37,7 @@ futimens (int fd, const struct timespec tsp[2]) __set_errno (EBADF); return -1; } - return INLINE_SYSCALL (utimensat, 4, fd, NULL, tsp, 0); + return INLINE_SYSCALL (utimensat, 4, fd, NULL, &tsp[0], 0); #else __set_errno (ENOSYS); return -1; diff --git a/sysdeps/unix/sysv/linux/futimesat.c b/sysdeps/unix/sysv/linux/futimesat.c index ac96e2a..e2cba1a 100644 --- a/sysdeps/unix/sysv/linux/futimesat.c +++ b/sysdeps/unix/sysv/linux/futimesat.c @@ -28,13 +28,10 @@ /* 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); + return INLINE_SYSCALL (futimesat, 3, fd, file, &tvp[0]); } diff --git a/sysdeps/unix/sysv/linux/utimensat.c b/sysdeps/unix/sysv/linux/utimensat.c index 5a5dec7..24fd13a 100644 --- a/sysdeps/unix/sysv/linux/utimensat.c +++ b/sysdeps/unix/sysv/linux/utimensat.c @@ -35,7 +35,7 @@ utimensat (int fd, const char *file, const struct timespec tsp[2], return -1; } #ifdef __NR_utimensat - return INLINE_SYSCALL (utimensat, 4, fd, file, tsp, flags); + return INLINE_SYSCALL (utimensat, 4, fd, file, &tsp[0], flags); #else __set_errno (ENOSYS); return -1; diff --git a/sysdeps/unix/sysv/linux/utimes.c b/sysdeps/unix/sysv/linux/utimes.c index 5423ff2..8864e48 100644 --- a/sysdeps/unix/sysv/linux/utimes.c +++ b/sysdeps/unix/sysv/linux/utimes.c @@ -29,7 +29,7 @@ int __utimes (const char *file, const struct timeval tvp[2]) { - return INLINE_SYSCALL (utimes, 2, file, tvp); + return INLINE_SYSCALL (utimes, 2, file, &tvp[0]); } weak_alias (__utimes, utimes)