This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libgo patch committed: Update to weekly.2012-02-14 release
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Fri, 02 Mar 2012 20:13:09 +0100
- Subject: Re: libgo patch committed: Update to weekly.2012-02-14 release
- References: <mcrpqcvhs9w.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
Ian Lance Taylor <iant@google.com> writes:
> I have committed a patch to libgo to update to the weekly.2012-02-14
> release. As usual, in this e-mail message I only include the patches to
> files specific to the gccgo version of libgo. Bootstrapped and ran Go
> testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
This broke Solaris 10 (and probably 9 also) bootstrap:
/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c: In function 'mmap_fixed':
/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:47:2: error: pointer targets in passing argument 1 of 'mmap' differ in signedness [-Werror=pointer-sign]
In file included from /vol/gcc/src/hg/trunk/local/libgo/runtime/runtime.h:23:0,
from /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:8:
/usr/include/sys/mman.h:168:16: note: expected 'caddr_t' but argument is of type 'byte *'
/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:53:3: error: pointer targets in passing argument 1 of 'mmap' differ in signedness [-Werror=pointer-sign]
In file included from /vol/gcc/src/hg/trunk/local/libgo/runtime/runtime.h:23:0,
from /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:8:
/usr/include/sys/mman.h:168:16: note: expected 'caddr_t' but argument is of type 'byte *'
cc1: all warnings being treated as errors
The first mmap arg is caddr_t (char *), while byte * is uint8 *.
Casting to void * fixes this.
Rainer
# HG changeset patch
# Parent 3c65bd27734429765e18be13aeb46e624807b984
Cast mmap addr to void *
diff --git a/libgo/runtime/mem.c b/libgo/runtime/mem.c
--- a/libgo/runtime/mem.c
+++ b/libgo/runtime/mem.c
@@ -44,13 +44,13 @@ mmap_fixed(byte *v, uintptr n, int32 pro
{
void *p;
- p = runtime_mmap(v, n, prot, flags, fd, offset);
+ p = runtime_mmap((void *)v, n, prot, flags, fd, offset);
if(p != v && addrspace_free(v, n)) {
// On some systems, mmap ignores v without
// MAP_FIXED, so retry if the address space is free.
if(p != MAP_FAILED)
runtime_munmap(p, n);
- p = runtime_mmap(v, n, prot, flags|MAP_FIXED, fd, offset);
+ p = runtime_mmap((void *)v, n, prot, flags|MAP_FIXED, fd, offset);
}
return p;
}
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University