C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
13-79
RUNNABLE
RUNNABLE
The RUNNABLE pragma directs the compiler to generate an executable object file
instead of a linkable object file for a single-module program.
The pragma default settings are:
Usage Guidelines
The RUNNABLE pragma can be specified only on the compiler RUN command line
for the native C and C++ compilers.
If you specify RUNNABLE in a translation unit that does not define the function
main, the compiler generates a warning and produces a linkable, not executable,
object file.
The RUNNABLE pragma has no effect if the compiler is run from the OSS
environment. The compiler ignores the pragma.
When you specify the RUNNABLE pragma, the native C and C++ compilers does:
°
Invoke the appropriate linker for conventional or PIC (Position-Independent
Code)
°
Specify the $SYSTEM.SYSTEM.LIBCOBEY command file to a TNS/R linker
The LIBCOBEY file directs the linker to link to a set of standard shared run-
time libraries (SRLs). For most C and C++ TNS/R programs, this set of
libraries is sufficient to create an executable program.
If your program requires libraries not specified in LIBCOBEY (such as the
Tools.h++ library) you can direct the linker to search additional libraries
using the LINKFILE pragma. For more details, see LINKFILE on
page 13-57.
For information on linking TNS/R C and C++ programs, see Linking a TNS/R
Module on page 16-12.
For information on linking TNS/E C and C++ programs, see Linking a TNS/E
Module on page 17-12.
RUNNABLE
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler Not set Not set
G-series TNS c89 utility N.A. N.A.
TNS/R native C and C++ compilers Not set Not set
Native c89 utility N.A. N.A.
TNS/E native C and C++ compilers Not set Not set