From 6796df65e4d8320e1eb3b9e74dcd972a0bd6ae20 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 26 Mar 2010 10:25:53 -0700 Subject: [PATCH] alpha: Fix the return type of the atomic.h macros. Signed-off-by: Richard Henderson --- ChangeLog.alpha | 8 ++++++++ sysdeps/alpha/bits/atomic.h | 14 +++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog.alpha b/ChangeLog.alpha index 4cf27f4..4e2eb5b 100644 --- a/ChangeLog.alpha +++ b/ChangeLog.alpha @@ -1,3 +1,11 @@ +2010-03-26 Richard Henderson + + * sysdeps/alpha/bits/atomic.h (__arch_exchange_8_int, + __arch_exchange_16_int, __arch_exchange_32_int, + __arch_exchange_64_int, __arch_exchange_and_add_32_int, + __arch_exchange_and_add_64_int): Use __typeof to get the + return type correct without warning. + 2010-03-23 Matt Turner Aurelien Jarno diff --git a/sysdeps/alpha/bits/atomic.h b/sysdeps/alpha/bits/atomic.h index 36a740c..602fde3 100644 --- a/sysdeps/alpha/bits/atomic.h +++ b/sysdeps/alpha/bits/atomic.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -221,7 +221,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_exchange_8_int(mem, value, mb1, mb2) \ ({ \ - unsigned long __ret, __tmp, __addr64, __sval; \ + unsigned long __tmp, __addr64, __sval; __typeof(*mem) __ret; \ __asm__ __volatile__ ( \ mb1 \ " andnot %[__addr8],7,%[__addr64]\n" \ @@ -244,7 +244,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_exchange_16_int(mem, value, mb1, mb2) \ ({ \ - unsigned long __ret, __tmp, __addr64, __sval; \ + unsigned long __tmp, __addr64, __sval; __typeof(*mem) __ret; \ __asm__ __volatile__ ( \ mb1 \ " andnot %[__addr16],7,%[__addr64]\n" \ @@ -267,7 +267,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_exchange_32_int(mem, value, mb1, mb2) \ ({ \ - signed int __ret, __tmp; \ + signed int __tmp; __typeof(*mem) __ret; \ __asm__ __volatile__ ( \ mb1 \ "1: ldl_l %[__ret],%[__mem]\n" \ @@ -284,7 +284,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_exchange_64_int(mem, value, mb1, mb2) \ ({ \ - unsigned long __ret, __tmp; \ + unsigned long __tmp; __typeof(*mem) __ret; \ __asm__ __volatile__ ( \ mb1 \ "1: ldq_l %[__ret],%[__mem]\n" \ @@ -316,7 +316,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_exchange_and_add_32_int(mem, value, mb1, mb2) \ ({ \ - signed int __ret, __tmp; \ + signed int __tmp; __typeof(*mem) __ret; \ __asm__ __volatile__ ( \ mb1 \ "1: ldl_l %[__ret],%[__mem]\n" \ @@ -333,7 +333,7 @@ typedef uintmax_t uatomic_max_t; #define __arch_exchange_and_add_64_int(mem, value, mb1, mb2) \ ({ \ - unsigned long __ret, __tmp; \ + unsigned long __tmp; __typeof(*mem) __ret; \ __asm__ __volatile__ ( \ mb1 \ "1: ldq_l %[__ret],%[__mem]\n" \ -- 2.7.4