From patchwork Tue Feb 4 22:20:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 316772 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 89FDF2C0096 for ; Wed, 5 Feb 2014 09:21:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 980832669F; Tue, 4 Feb 2014 22:21:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XCnwk26K99U3; Tue, 4 Feb 2014 22:21:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 82EA7264E9; Tue, 4 Feb 2014 22:21:33 +0000 (UTC) X-Original-To: uclibc@lists.busybox.net Delivered-To: uclibc@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id E5AF61BF991 for ; Tue, 4 Feb 2014 22:21:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DFFBA8BB5C for ; Tue, 4 Feb 2014 22:21:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qvi+k+RDURT4 for ; Tue, 4 Feb 2014 22:21:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from multi.imgtec.com (multi.imgtec.com [194.200.65.239]) by whitealder.osuosl.org (Postfix) with ESMTPS id 088148ADF1 for ; Tue, 4 Feb 2014 22:21:29 +0000 (UTC) From: "Steve Ellcey " Date: Tue, 4 Feb 2014 14:20:40 -0800 To: Subject: [PATCH] Fix warnings in MIPS build User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-ID: <580be99c-9b37-4ed2-b08b-b3d9f0374040@BAMAIL02.ba.imgtec.org> X-SEF-Processed: 7_3_0_01192__2014_02_04_22_21_25 X-BeenThere: uclibc@uclibc.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion and development of uClibc \(the embedded C library\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: uclibc-bounces@uclibc.org Sender: uclibc-bounces@uclibc.org This patch fixes the rest of the set-but-not-used warnings in the MIPS code by using attribute_unused and also fixes some conversion warnings by changing __arch_compare_and_exchange_xxx_[8|16]_int. Assigning __cmp (int type) to __prev (pointer type) generates a warning. Assigning zero to each separately avoids this warning without having to add a cast. Signed-off-by: Steve Ellcey --- libc/sysdeps/linux/mips/bits/atomic.h | 14 +++++++------- .../sysdeps/unix/sysv/linux/mips/lowlevellock.h | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libc/sysdeps/linux/mips/bits/atomic.h b/libc/sysdeps/linux/mips/bits/atomic.h index 60ee0a6..e4f9e3b 100644 --- a/libc/sysdeps/linux/mips/bits/atomic.h +++ b/libc/sysdeps/linux/mips/bits/atomic.h @@ -83,10 +83,10 @@ typedef uintmax_t uatomic_max_t; in which values are returned. */ #define __arch_compare_and_exchange_xxx_8_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = __cmp = 0) + (abort (), __prev = 0, __cmp = 0) #define __arch_compare_and_exchange_xxx_16_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = __cmp = 0) + (abort (), __prev = 0, __cmp = 0) #define __arch_compare_and_exchange_xxx_32_int(mem, newval, oldval, rel, acq) \ __asm__ __volatile__ ( \ @@ -110,7 +110,7 @@ typedef uintmax_t uatomic_max_t; #if _MIPS_SIM == _ABIO32 /* We can't do an atomic 64-bit operation in O32. */ #define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \ - (abort (), __prev = __cmp = 0) + (abort (), __prev = 0, __cmp = 0) #else #define __arch_compare_and_exchange_xxx_64_int(mem, newval, oldval, rel, acq) \ __asm__ __volatile__ ("\n" \ @@ -158,22 +158,22 @@ typedef uintmax_t uatomic_max_t; successful or not. */ #define __arch_compare_and_exchange_val_8_int(mem, new, old, rel, acq) \ -({ __typeof (*mem) __prev attribute_unused; int __cmp; \ +({ __typeof (*mem) __prev attribute_unused; int __cmp attribute_unused; \ __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq); \ (__typeof (*mem))__prev; }) #define __arch_compare_and_exchange_val_16_int(mem, new, old, rel, acq) \ -({ __typeof (*mem) __prev attribute_unused; int __cmp; \ +({ __typeof (*mem) __prev attribute_unused; int __cmp attribute_unused; \ __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq); \ (__typeof (*mem))__prev; }) #define __arch_compare_and_exchange_val_32_int(mem, new, old, rel, acq) \ -({ __typeof (*mem) __prev attribute_unused; int __cmp; \ +({ __typeof (*mem) __prev attribute_unused; int __cmp attribute_unused; \ __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq); \ (__typeof (*mem))__prev; }) #define __arch_compare_and_exchange_val_64_int(mem, new, old, rel, acq) \ -({ __typeof (*mem) __prev attribute_unused; int __cmp; \ +({ __typeof (*mem) __prev attribute_unused; int __cmp attribute_unused; \ __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq); \ (__typeof (*mem))__prev; }) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h index f3246ca..450a286 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/lowlevellock.h @@ -80,7 +80,7 @@ #define lll_futex_timed_wait(futexp, val, timespec, private) \ ({ \ INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ + long int __ret attribute_unused; \ __ret = INTERNAL_SYSCALL (futex, __err, 4, (long) (futexp), \ __lll_private_flag (FUTEX_WAIT, private), \ (val), (timespec)); \ @@ -90,7 +90,7 @@ #define lll_futex_wake(futexp, nr, private) \ ({ \ INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ + long int __ret attribute_unused; \ __ret = INTERNAL_SYSCALL (futex, __err, 4, (long) (futexp), \ __lll_private_flag (FUTEX_WAKE, private), \ (nr), 0); \ @@ -110,7 +110,7 @@ #define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \ ({ \ INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ + long int __ret attribute_unused; \ __ret = INTERNAL_SYSCALL (futex, __err, 6, (long) (futexp), \ __lll_private_flag (FUTEX_CMP_REQUEUE, private),\ (nr_wake), (nr_move), (mutex), (val)); \ @@ -121,7 +121,7 @@ #define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \ ({ \ INTERNAL_SYSCALL_DECL (__err); \ - long int __ret; \ + long int __ret attribute_unused; \ \ __ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \ __lll_private_flag (FUTEX_WAKE_OP, private), \