This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Get rid of a few unsigned/signed warnings


The appended patch gets rid of these warnings:
../sysdeps/generic/dl-cache.c:222: warning: comparison between signed and unsigned
../sysdeps/generic/readelflib.c:103: warning: comparison between signed and unsigned
../sysdeps/generic/readelflib.c:148: warning: comparison between signed and unsigned

Ok to commit?

Andreas

2002-12-28  Andreas Jaeger  <aj@suse.de>

	* sysdeps/generic/readelflib.c (process_elf_file): Cast value to
	avoid warning.
	* sysdeps/generic/dl-cache.c (_dl_load_cache_lookup): Likewise.

============================================================
Index: sysdeps/generic/dl-cache.c
--- sysdeps/generic/dl-cache.c	6 Feb 2002 14:14:34 -0000	1.41
+++ sysdeps/generic/dl-cache.c	28 Dec 2002 14:59:02 -0000
@@ -219,7 +219,7 @@ _dl_load_cache_lookup (const char *name)
 
       hwcap = &GL(dl_hwcap);
       platform = _dl_string_platform (GL(dl_platform));
-      if (platform != -1)
+      if (platform != (uint64_t)-1)
 	platform = 1ULL << platform;
 
       /* Only accept hwcap if it's for the right platform.  */
============================================================
Index: sysdeps/generic/readelflib.c
--- sysdeps/generic/readelflib.c	29 Aug 2002 20:39:24 -0000	1.8
+++ sysdeps/generic/readelflib.c	28 Dec 2002 14:59:02 -0000
@@ -100,7 +100,7 @@ process_elf_file (const char *file_name,
       switch (segment->p_type)
 	{
 	case PT_LOAD:
-	  if (loadaddr == -1)
+	  if (loadaddr == (ElfW(Addr))-1)
 	    loadaddr = segment->p_vaddr - segment->p_offset;
 	  break;
 
@@ -145,7 +145,7 @@ process_elf_file (const char *file_name,
 	}
 
     }
-  if (loadaddr == -1)
+  if (loadaddr == (ElfW(Addr))-1)
     {
       /* Very strange. */
       loadaddr = 0;

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]