This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

3.4 PATCH: Fix Tru64 UNIX V4.0F bootstrap failure


Current mainline failed to bootstrap on alpha-dec-osf4.0f:

/vol/gnu/src/gcc/gcc/gcc/ggc-common.c: In function `gt_pch_save':
/vol/gnu/src/gcc/gcc/gcc/ggc-common.c:460: warning: comparison between pointer and integer
/vol/gnu/src/gcc/gcc/gcc/ggc-common.c: In function `gt_pch_restore':
/vol/gnu/src/gcc/gcc/gcc/ggc-common.c:612: warning: comparison between pointer and integer

This happens because (unlike Tru64 UNIX V5.1), <sys/mman.h> defines

#define MAP_FAILED	(-1L)	/* unsuccessful return from mmap() */

The following patch fixes this and allows the bootstrap to continue.

Ok for mainline if it passes?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Tue Jul  1 14:19:20 2003  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* ggc-common.c (gt_pch_save): Cast MAP_FAILED to void *.
	(gt_pch_restore): Likewise.

Index: gcc/ggc-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-common.c,v
retrieving revision 1.70
diff -u -p -r1.70 ggc-common.c
--- gcc/ggc-common.c	8 Jun 2003 06:41:28 -0000	1.70
+++ gcc/ggc-common.c	1 Jul 2003 13:05:21 -0000
@@ -457,7 +457,7 @@ gt_pch_save (FILE *f)
   mmi.preferred_base = mmap (NULL, mmi.size,
 			     PROT_READ | PROT_WRITE, MAP_PRIVATE,
 			     fileno (state.f), 0);
-  if (mmi.preferred_base == MAP_FAILED)
+  if (mmi.preferred_base == (void *) MAP_FAILED)
     mmi.preferred_base = NULL;
   else
     munmap (mmi.preferred_base, mmi.size);
@@ -582,7 +582,7 @@ gt_pch_restore (FILE *f)
       size_t page_size = getpagesize();
       char one_byte;
 
-      if (addr != MAP_FAILED)
+      if (addr != (void *) MAP_FAILED)
 	munmap (addr, mmi.size);
 
       /* We really want to be mapped at mmi.preferred_base
@@ -609,7 +609,7 @@ gt_pch_restore (FILE *f)
 #else /* HAVE_MMAP_FILE */
   addr = MAP_FAILED;
 #endif /* HAVE_MMAP_FILE */
-  if (addr == MAP_FAILED)
+  if (addr == (void *) MAP_FAILED)
     {
       addr = xmalloc (mmi.size);
       if (fseek (f, mmi.offset, SEEK_SET) != 0


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