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-20
ENV
ENV
The ENV pragma specifies the intended run-time environment of an object file.
COMMON
specifies that the module requires the Common Run-Time Environment (CRE).
The module can be called by routines written in any language that runs in the CRE.
Use this option for user code functions that run in the CRE.
For the native C and C++ compilers, this option sets the _COMMON feature-test
macro.
EMBEDDED
specifies that the module does not require resources provided by the CRE and that
it meets the requirements to run in the system code space.
The module can be called from routines written in any language, regardless of
whether the routines run in the CRE. Use this option for user code functions that
do not rely on run-time libraries. It is intended for system-level programming. For
additional considerations, see Section 9, System-Level Programming.
You must verify that code does not use the C run-time library and other CRE
resources. The compiler performs no verification. Specifying ENV EMBEDDED does
not make code that uses the C run-time library and other CRE resources able to
run in the system code space.
For the native C and C++ compilers, this option sets the _EMBEDDED feature-test
macro.
LIBRARY
specifies that the module requires the CRE and that the module meets the
requirements to run in the user library space.
The module can be called by routines written only in C or C++. Use this option for
TNS user library functions. Do not use this option for native user library functions.
TNS user library programs can call a very limited number of C run-time library
functions. Specifically, TNS user library programs cannot call functions that require
ENV env-option
env-option:
{ COMMON }
{ EMBEDDED }
{ LIBRARY }
{ LIBSPACE }