alpha warning cleanup
Richard Henderson
rth@twiddle.net
Tue Jan 13 09:02:00 GMT 2004
A grab-bag of various warnings fixed.
The cast-up-cast-down bits in atomic.h prevent 3 "cast from pointer
to integer of different size" warnings in the unused branches.
The rest of the changes are largely for thinkos.
Ok?
r~
* sysdeps/alpha/bits/atomic.h (__arch_compare_and_exchange_xxx_8_int):
Cast old up to uint64_t before back down to inner width.
(__arch_compare_and_exchange_xxx_16_int): Likewise.
(__arch_compare_and_exchange_xxx_32_int): Likewise.
(__arch_compare_and_exchange_xxx_64_int): Likewise.
(__arch_compare_and_exchange_val_8_int): Cast result to
the type of the memory.
(__arch_compare_and_exchange_val_16_int): Likewise.
(__arch_compare_and_exchange_val_32_int): Likewise.
(__arch_compare_and_exchange_val_64_int): Likewise.
(atomic_compare_and_exchange_bool_acq): Use __atomic_bool_bysize.
(atomic_compare_and_exchange_bool_rel): Likewise.
* sysdeps/unix/alpha/sysdep.h: Select inline_syscall_r0_asm
based on HAVE___THREAD instead of USE_TLS.
* sysdeps/unix/sysv/linux/alpha/adjtime.c (ADJTIMEX32): New.
(__adjtimex_tv64): Use it.
* sysdeps/unix/sysv/linux/alpha/semctl.c (__new_semctl): Cast
to void* rather than directly to the compatibility structure type.
* sysdeps/unix/sysv/linux/alpha/shmctl.c (__new_shmctl): Likewise.
* sysdeps/unix/sysv/linux/alpha/sigaction.c (struct kernel_sigaction):
Forward declare.
Index: sysdeps/alpha/bits/atomic.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/bits/atomic.h,v
retrieving revision 1.2
diff -c -p -d -u -r1.2 atomic.h
--- sysdeps/alpha/bits/atomic.h 30 Jun 2003 23:21:38 -0000 1.2
+++ sysdeps/alpha/bits/atomic.h 13 Jan 2004 08:52:37 -0000
@@ -78,7 +78,7 @@ typedef uintmax_t uatomic_max_t;
[__cmp] "=&r" (__cmp), \
[__addr64] "=&r" (__addr64) \
: [__addr8] "r" (mem), \
- [__old] "Ir" ((uint64_t)(uint8_t)(old)), \
+ [__old] "Ir" ((uint64_t)(uint8_t)(uint64_t)(old)), \
[__new] "r" (new) \
: "memory"); \
})
@@ -106,7 +106,7 @@ typedef uintmax_t uatomic_max_t;
[__cmp] "=&r" (__cmp), \
[__addr64] "=&r" (__addr64) \
: [__addr16] "r" (mem), \
- [__old] "Ir" ((uint64_t)(uint16_t)(old)), \
+ [__old] "Ir" ((uint64_t)(uint16_t)(uint64_t)(old)), \
[__new] "r" (new) \
: "memory"); \
})
@@ -126,7 +126,7 @@ typedef uintmax_t uatomic_max_t;
: [__prev] "=&r" (__prev), \
[__cmp] "=&r" (__cmp) \
: [__mem] "m" (*(mem)), \
- [__old] "Ir" ((uint64_t)(atomic32_t)(old)), \
+ [__old] "Ir" ((uint64_t)(atomic32_t)(uint64_t)(old)), \
[__new] "Ir" (new) \
: "memory"); \
})
@@ -146,7 +146,7 @@ typedef uintmax_t uatomic_max_t;
: [__prev] "=&r" (__prev), \
[__cmp] "=&r" (__cmp) \
: [__mem] "m" (*(mem)), \
- [__old] "Ir" (old), \
+ [__old] "Ir" ((uint64_t)(old)), \
[__new] "Ir" (new) \
: "memory"); \
})
@@ -179,28 +179,28 @@ typedef uintmax_t uatomic_max_t;
#define __arch_compare_and_exchange_val_8_int(mem, new, old, mb1, mb2) \
({ unsigned long __prev; int __cmp; \
__arch_compare_and_exchange_xxx_8_int(mem, new, old, mb1, mb2); \
- __prev; })
+ (typeof (*mem))__prev; })
#define __arch_compare_and_exchange_val_16_int(mem, new, old, mb1, mb2) \
({ unsigned long __prev; int __cmp; \
__arch_compare_and_exchange_xxx_16_int(mem, new, old, mb1, mb2); \
- __prev; })
+ (typeof (*mem))__prev; })
#define __arch_compare_and_exchange_val_32_int(mem, new, old, mb1, mb2) \
({ unsigned long __prev; int __cmp; \
__arch_compare_and_exchange_xxx_32_int(mem, new, old, mb1, mb2); \
- __prev; })
+ (typeof (*mem))__prev; })
#define __arch_compare_and_exchange_val_64_int(mem, new, old, mb1, mb2) \
({ unsigned long __prev; int __cmp; \
__arch_compare_and_exchange_xxx_64_int(mem, new, old, mb1, mb2); \
- __prev; })
+ (typeof (*mem))__prev; })
/* Compare and exchange with "acquire" semantics, ie barrier after. */
#define atomic_compare_and_exchange_bool_acq(mem, new, old) \
- __atomic_val_bysize (__arch_compare_and_exchange_bool, int, \
- mem, new, old, "", __MB)
+ __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
+ mem, new, old, "", __MB)
#define atomic_compare_and_exchange_val_acq(mem, new, old) \
__atomic_val_bysize (__arch_compare_and_exchange_val, int, \
@@ -209,8 +209,8 @@ typedef uintmax_t uatomic_max_t;
/* Compare and exchange with "release" semantics, ie barrier before. */
#define atomic_compare_and_exchange_bool_rel(mem, new, old) \
- __atomic_val_bysize (__arch_compare_and_exchange_bool, int, \
- mem, new, old, __MB, "")
+ __atomic_bool_bysize (__arch_compare_and_exchange_bool, int, \
+ mem, new, old, __MB, "")
#define atomic_compare_and_exchange_val_rel(mem, new, old) \
__atomic_val_bysize (__arch_compare_and_exchange_val, int, \
Index: sysdeps/unix/alpha/sysdep.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/alpha/sysdep.h,v
retrieving revision 1.19
diff -c -p -d -u -r1.19 sysdep.h
--- sysdeps/unix/alpha/sysdep.h 17 Aug 2003 00:33:13 -0000 1.19
+++ sysdeps/unix/alpha/sysdep.h 13 Jan 2004 08:52:38 -0000
@@ -205,7 +205,7 @@ __LABEL(name) \
output. We don't do this unconditionally to allow compilation with
older compilers. */
-#ifdef USE_TLS
+#ifdef HAVE___THREAD
#define inline_syscall_r0_asm
#define inline_syscall_r0_out_constraint "=v"
#else
Index: sysdeps/unix/sysv/linux/alpha/adjtime.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/adjtime.c,v
retrieving revision 1.8
diff -c -p -d -u -r1.8 adjtime.c
--- sysdeps/unix/sysv/linux/alpha/adjtime.c 20 Jun 2003 16:24:36 -0000 1.8
+++ sysdeps/unix/sysv/linux/alpha/adjtime.c 13 Jan 2004 08:52:40 -0000
@@ -60,6 +60,7 @@ struct timex32 {
#define TIMEX timex32
#define ADJTIME __adjtime_tv32
#define ADJTIMEX(x) INLINE_SYSCALL (old_adjtimex, 1, x)
+#define ADJTIMEX32(x) INLINE_SYSCALL (old_adjtimex, 1, x)
#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
#define LINKAGE
#else
@@ -180,7 +181,7 @@ __adjtimex_tv64 (struct timex *tx)
tx32.errcnt = tx->errcnt;
tx32.stbcnt = tx->stbcnt;
- ret = __adjtimex_tv32 (&tx32);
+ ret = ADJTIMEX32 (&tx32);
if (ret == 0)
{
tx->modes = tx32.modes;
Index: sysdeps/unix/sysv/linux/alpha/semctl.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/semctl.c,v
retrieving revision 1.7
diff -c -p -d -u -r1.7 semctl.c
--- sysdeps/unix/sysv/linux/alpha/semctl.c 3 Sep 2003 03:21:26 -0000 1.7
+++ sysdeps/unix/sysv/linux/alpha/semctl.c 13 Jan 2004 08:52:40 -0000
@@ -97,7 +97,7 @@ __new_semctl (int semid, int semnum, int
__set_errno(save_errno);
buf = arg.buf;
- arg.buf = (struct semid_ds *)&old;
+ arg.buf = (void *)&old;
if (cmd == IPC_SET)
{
old.sem_perm.uid = buf->sem_perm.uid;
Index: sysdeps/unix/sysv/linux/alpha/shmctl.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/shmctl.c,v
retrieving revision 1.6
diff -c -p -d -u -r1.6 shmctl.c
--- sysdeps/unix/sysv/linux/alpha/shmctl.c 3 Sep 2003 03:21:26 -0000 1.6
+++ sysdeps/unix/sysv/linux/alpha/shmctl.c 13 Jan 2004 08:52:40 -0000
@@ -116,7 +116,7 @@ __new_shmctl (int shmid, int cmd, struct
}
else if (result != -1 && cmd == IPC_INFO)
{
- struct __old_shminfo *oldi = (struct __old_shminfo *)&old;
+ struct __old_shminfo *oldi = (void *)&old;
struct shminfo *i = (struct shminfo *)buf;
memset(i, 0, sizeof(*i));
Index: sysdeps/unix/sysv/linux/alpha/sigaction.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/sigaction.c,v
retrieving revision 1.2
diff -c -p -d -u -r1.2 sigaction.c
--- sysdeps/unix/sysv/linux/alpha/sigaction.c 3 Sep 2003 03:15:08 -0000 1.2
+++ sysdeps/unix/sysv/linux/alpha/sigaction.c 13 Jan 2004 08:52:40 -0000
@@ -30,6 +30,7 @@
? __syscall_rt_sigaction(args) \
: INLINE_SYSCALL1(name, nr, args))
+struct kernel_sigaction;
extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded,
struct kernel_sigaction *__unbounded, size_t);
More information about the Libc-alpha
mailing list