This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gccgo] Don't declare malloc in libgo/runtime.h
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 03 Dec 2009 06:22:04 -0800
- Subject: [gccgo] Don't declare malloc in libgo/runtime.h
The file libgo/runtime.h is partially copied from the other Go
library. It declares malloc. In the gccgo context, this is harmful
is malloc winds up getting declared by a system header file such as
<sys/mman.h>. This fixes
http://code.google.com/p/go/issues/detail?id=356
Committed to gccgo branch.
Ian
Index: libgo/runtime/runtime.h
===================================================================
--- libgo/runtime/runtime.h (revision 154387)
+++ libgo/runtime/runtime.h (working copy)
@@ -87,6 +87,5 @@ struct M
#define sys_memclr(buf, size) __builtin_memset(buf, 0, size)
#define sys_mmap mmap
MCache* allocmcache(void);
-void* malloc(uintptr size);
void* mallocgc(uintptr size);
void free(void *v);