[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page

Top Document: comp.unix.aix Frequently Asked Questions (Part 3 of 5)
Previous Document: 2.00: C/C++
Next Document: 2.02: How do I compile my BSD programs?


2.01: I cannot make alloca work


A famous routine, in particular in GNU context, is the allocation
routine alloca().  Alloca allocates memory in such a way that it is
automatically free'd when the block is exited.  Most implementations
does this by adjusting the stack pointer.  Since not all C environments
can support it, its use is discouraged, but it is included in the xlc
compiler.  In order to make the compiler aware that you intend to use
alloca, you must put the line

#pragma alloca

before any other statements in the C source module(s) where alloca is
called.  If you don't do this, xlc will not recognize alloca as anything
special, and you will get errors during linking.

For AIX 3.2, it may be easier to use the -ma flag.



Top Document: comp.unix.aix Frequently Asked Questions (Part 3 of 5)
Previous Document: 2.00: C/C++
Next Document: 2.02: How do I compile my BSD programs?

Part1 - Part2 - Part3 - Part4 - Part5 - Single Page


[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
bofh@mail.teleweb.pt (Jose Pina Coelho)

Last Update October 22 2009 @ 05:22 AM

Some parts © 2009 Advameg, Inc.