HP aC++ Release Notes Version A.03.95 (5900-1789; September 2011)

HP aC++ Release Notes
Problem Descriptions and Fixes, and Known Limitations
Chapter 1 81
If you want to link archive libraries and libdld.sl, use the -Wl,-a, archive option. The
following example directs the linker to use the archive version of standard libraries and (by default)
libdld.sl.
aCC prog.o -Wl,-a,archive
Using shl_load with Library-Level Versioning
Once library-level versioning is used, calls to shl_load() should specify the actual version of the
library that is to be loaded. For example, if libA.sl is now a symbolic link to libA.1, then calls to
dynamically load this library should specify the latest version available when the application is
compiled, such as:
shl_load("libA.1", BIND_DEFERRED, 0);
This will ensure that, when the application is migrated to a system that has a later version of libA
available, the actual version desired is the one that is dynamically loaded.
Memory Allocation Routine alloca()
The compiler supports the built in function, alloca(), defined in the /usr/include/alloca.h
header file. The implementation of the alloca() routine is system dependent, and its use is not
encouraged.
alloca() is a memory allocation routine similar to malloc(). The syntax is:
void *alloca(size_t <size>);
alloca() allocates space from the stack of the caller for a block of least size bytes, but does not
initialize the space. The space is automatically freed when the calling routine exits.
NOTE Memory returned by alloca() is not related to memory allocated by other memory
allocation functions. Behavior of addresses returned by alloca() as parameters to
other memory functions is undefined.
To use this function, you must use the <alloca.h> header file.