From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21523 invoked by alias); 5 May 2003 15:21:45 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 21506 invoked from network); 5 May 2003 15:21:44 -0000 Received: from unknown (HELO localhost.localdomain) (195.113.19.66) by sources.redhat.com with SMTP; 5 May 2003 15:21:44 -0000 Received: from sunsite.ms.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h45FLgqO008209; Mon, 5 May 2003 17:21:42 +0200 Received: (from jakub@localhost) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8/Submit) id h45FLgJr008207; Mon, 5 May 2003 17:21:42 +0200 Date: Mon, 05 May 2003 15:21:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Roland McGrath Cc: Glibc hackers Subject: [PATCH] Kill some warnings Message-ID: <20030505152142.GU16629@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2003-05/txt/msg00005.txt.bz2 Hi! This patch fixes some warnings I've noticed on s390x. This also changes s390x INLINE/INTERNAL syscall to return long instead of int, otherwise things like shmat IMHO work by sheer luck. 2003-05-05 Jakub Jelinek * sysdeps/ia64/bits/atomic.h (__arch_compare_and_exchange_val_8_acq, __arch_compare_and_exchange_val_16_acq): Cast 0 to mem's type. * sysdeps/powerpc/powerpc32/bits/atomic.h (__arch_compare_and_exchange_val_64_acq): Likewise. * sysdeps/sparc/sparc32/sparcv9/bits/atomic.h (__arch_compare_and_exchange_val_8_acq, __arch_compare_and_exchange_val_16_acq, __arch_compare_and_exchange_val_64_acq): Likewise. * sysdeps/sparc/sparc64/bits/atomic.h (__arch_compare_and_exchange_val_8_acq, __arch_compare_and_exchange_val_16_acq): Likewise. * sysdeps/s390/bits/atomic.h (__arch_compare_and_exchange_val_8_acq, __arch_compare_and_exchange_val_16_acq, __arch_compare_and_exchange_val_64_acq): Likewise. * sysdeps/unix/sysv/linux/sh/bits/atomic.h (__arch_compare_and_exchange_val_64_acq): Likewise. * sysdeps/s390/s390-64/backtrace.c (__backtrace): Add cast to shut up warning. * sysdeps/s390/fpu/fegetenv.c (fegetenv): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (INLINE_SYSCALL, INTERNAL_SYSCALL_DIRECT, INTERNAL_SYSCALL_SVC0): Return long instead of int. (INTERNAL_SYSCALL_ERROR_P): Cast val to unsigned long, replace 0xfffff001u with -4095UL. localedata/ * tests-mbwc/tst_wcsxfrm.c (tst_wcsxfrm): Use %zu instead of %d format specifier when printing ret. --- libc/localedata/tests-mbwc/tst_wcsxfrm.c.jj 2000-06-27 11:53:19.000000000 -0400 +++ libc/localedata/tests-mbwc/tst_wcsxfrm.c 2003-05-05 08:46:46.000000000 -0400 @@ -47,7 +47,7 @@ tst_wcsxfrm (FILE * fp, int debug_flg) if (debug_flg) { fprintf (stdout, "tst_wcsxfrm() : REC = %d\n", rec + 1); - fprintf (stdout, "tst_wcsxfrm() : 1st ret = %d\n", ret); + fprintf (stdout, "tst_wcsxfrm() : 1st ret = %zu\n", ret); } if (ret == -1 || ret >= n1 || errno_save != 0) @@ -78,7 +78,7 @@ tst_wcsxfrm (FILE * fp, int debug_flg) if (debug_flg) { - fprintf (stdout, "tst_wcsxfrm() : 2nd ret = %d\n", ret); + fprintf (stdout, "tst_wcsxfrm() : 2nd ret = %zu\n", ret); } /* wcscoll() */ --- libc/sysdeps/ia64/bits/atomic.h.jj 2003-03-26 11:50:35.000000000 -0500 +++ libc/sysdeps/ia64/bits/atomic.h 2003-05-05 08:26:50.000000000 -0400 @@ -60,10 +60,10 @@ typedef uintmax_t uatomic_max_t; (long) (newval))) #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ __sync_val_compare_and_swap_si ((int *) (mem), (int) (long) (oldval), \ --- libc/sysdeps/powerpc/powerpc32/bits/atomic.h.jj 2003-04-17 15:12:33.000000000 -0400 +++ libc/sysdeps/powerpc/powerpc32/bits/atomic.h 2003-05-05 08:27:31.000000000 -0400 @@ -49,7 +49,7 @@ (abort (), 0) # define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) # define __arch_atomic_exchange_64(mem, value) \ ({ abort (); (*mem) = (value); }) --- libc/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h.jj 2003-03-30 18:36:38.000000000 -0500 +++ libc/sysdeps/sparc/sparc32/sparcv9/bits/atomic.h 2003-05-05 08:30:22.000000000 -0400 @@ -47,10 +47,10 @@ typedef uintmax_t uatomic_max_t; #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ ({ \ @@ -64,7 +64,7 @@ typedef uintmax_t uatomic_max_t; /* This can be implemented if needed. */ #define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #define atomic_exchange(mem, newvalue) \ ({ __typeof (*(mem)) __oldval; \ --- libc/sysdeps/sparc/sparc64/bits/atomic.h.jj 2003-03-30 18:36:39.000000000 -0500 +++ libc/sysdeps/sparc/sparc64/bits/atomic.h 2003-05-05 08:31:37.000000000 -0400 @@ -47,10 +47,10 @@ typedef uintmax_t uatomic_max_t; #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ ({ \ --- libc/sysdeps/s390/s390-64/backtrace.c.jj 2001-08-23 12:50:18.000000000 -0400 +++ libc/sysdeps/s390/s390-64/backtrace.c 2003-05-05 08:37:14.000000000 -0400 @@ -70,7 +70,7 @@ __backtrace (array, size) out of range. */ break; - array[cnt++] = stack->save_grps[8]; + array[cnt++] = (void *) stack->save_grps[8]; stack = (struct layout *) stack->back_chain; } --- libc/sysdeps/s390/bits/atomic.h.jj 2003-03-26 11:50:36.000000000 -0500 +++ libc/sysdeps/s390/bits/atomic.h 2003-05-05 08:29:10.000000000 -0400 @@ -46,10 +46,10 @@ typedef uintmax_t uatomic_max_t; #define __arch_compare_and_exchange_val_8_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \ ({ __typeof (mem) __archmem = (mem); \ @@ -72,5 +72,5 @@ typedef uintmax_t uatomic_max_t; implement them by use of the csd instruction. The straightforward implementation causes warnings so we skip the definition for now. */ # define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #endif --- libc/sysdeps/s390/fpu/fegetenv.c.jj 2003-05-05 08:40:26.000000000 -0400 +++ libc/sysdeps/s390/fpu/fegetenv.c 2003-05-05 08:40:26.000000000 -0400 @@ -1,5 +1,5 @@ /* Store current floating-point environment. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Denis Joseph Barrow (djbarrow@de.ibm.com). @@ -36,7 +36,7 @@ fegetenv (fenv_t *envp) no way to find out the ieee instruction pointer if there was no fault. */ _FPU_GETCW (envp->fpc); envp->ieee_instruction_pointer = - ptrace (PTRACE_PEEKUSER, getpid (), PT_IEEE_IP); + (void *) ptrace (PTRACE_PEEKUSER, getpid (), PT_IEEE_IP); /* Success. */ return 0; --- libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h.jj 2003-04-06 17:03:54.000000000 -0400 +++ libc/sysdeps/unix/sysv/linux/sh/bits/atomic.h 2003-05-05 08:33:42.000000000 -0400 @@ -122,7 +122,7 @@ typedef uintmax_t uatomic_max_t; such an operation. So don't define any code for now. */ # define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \ - (abort (), 0) + (abort (), (__typeof (*mem)) 0) #define atomic_exchange_and_add(mem, value) \ ({ __typeof (*(mem)) __result, __tmp, __value = (value); \ --- libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h.jj 2003-03-25 16:41:54.000000000 -0500 +++ libc/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h 2003-05-03 19:39:18.000000000 -0400 @@ -163,13 +163,13 @@ #undef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) \ ({ \ - unsigned int _ret = INTERNAL_SYSCALL (name, , nr, args); \ + long _ret = INTERNAL_SYSCALL (name, , nr, args); \ if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_ret, ), 0)) \ { \ __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, )); \ _ret = -1; \ } \ - (int) _ret; }) + _ret; }) #undef INTERNAL_SYSCALL_DECL #define INTERNAL_SYSCALL_DECL(err) do { } while (0) @@ -178,7 +178,7 @@ #define INTERNAL_SYSCALL_DIRECT(name, err, nr, args...) \ ({ \ DECLARGS_##nr(args) \ - register int _ret asm("2"); \ + register long _ret asm("2"); \ asm volatile ( \ "svc %b1\n\t" \ : "=d" (_ret) \ @@ -191,7 +191,7 @@ ({ \ DECLARGS_##nr(args) \ register unsigned long _nr asm("1") = (unsigned long)(__NR_##name); \ - register int _ret asm("2"); \ + register long _ret asm("2"); \ asm volatile ( \ "svc 0\n\t" \ : "=d" (_ret) \ @@ -207,7 +207,7 @@ #undef INTERNAL_SYSCALL_ERROR_P #define INTERNAL_SYSCALL_ERROR_P(val, err) \ - ((unsigned int) (val) >= 0xfffff001u) + ((unsigned long) (val) >= -4095UL) #undef INTERNAL_SYSCALL_ERRNO #define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) Jakub