Ian Lance Taylor <i...@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