This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] make alloca.h work with xlc
- From: jschopp <jschopp at austin dot ibm dot com>
- To: Jeff Johnston <jjohnstn at redhat dot com>
- Cc: newlib at sources dot redhat dot com
- Date: Wed, 13 Dec 2006 16:37:48 -0600
- Subject: [PATCH] make alloca.h work with xlc
The xlc compiler defines alloca internally. Thus when it encounters the definition in
alloca.h it isn't very happy. The simple way to fix this is to add an undef alloca
unconditionally before defining it. After making the fix I checked and other libc headers
do this regularly as well.
Unlike most of my patches this one isn't cell spu specific, but is trivial enough it
shouldn't raise any objections.
2006-12-13 Joel Schopp <jschopp@austin.ibm.com>
* newlib/include/alloca.h: add undef alloca to work with xlc
Index: newlib-1.14.0/newlib/libc/include/alloca.h
===================================================================
--- newlib-1.14.0.orig/newlib/libc/include/alloca.h
+++ newlib-1.14.0/newlib/libc/include/alloca.h
@@ -10,6 +10,8 @@
#include "_ansi.h"
#include <sys/reent.h>
+#undef alloca
+
#ifdef __GNUC__
#define alloca(size) __builtin_alloca(size)
#else