[PATCH] make alloca.h work with xlc

Jeff Johnston jjohnstn@redhat.com
Thu Dec 14 20:06:00 GMT 2006


Patch checked in.

-- Jeff J.

jschopp wrote:
> 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



More information about the Newlib mailing list