Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.unix.aix Frequently Asked Questions (Part 3 of 5)
Section - 2.01: I cannot make alloca work

( Part1 - Part2 - Part3 - Part4 - Part5 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]


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?
See reader questions & answers on this topic! - Help others by sharing your knowledge
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.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




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 March 27 2014 @ 02:11 PM