public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>, Roland McGrath <roland@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Kill some warnings
Date: Mon, 05 May 2003 15:21:00 -0000	[thread overview]
Message-ID: <20030505152142.GU16629@sunsite.ms.mff.cuni.cz> (raw)

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  <jakub@redhat.com>

	* 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

             reply	other threads:[~2003-05-05 15:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-05 15:21 Jakub Jelinek [this message]
2003-05-05 18:24 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030505152142.GU16629@sunsite.ms.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).