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-21
ENV
relocatable data blocks (global data). Native user library programs can call the
entire C run-time library.
For the native C and C++ compilers, this option sets the _LIBRARY feature-test
macro.
LIBSPACE
specifies that the module does not require resources provided by the CRE and that
it meets the requirements to run in the user library space or system library space.
You must verify that code does not use the C run-time library and other CRE
resources. The compiler performs no verification. Specifying ENV LIBSPACE does
not make code that uses the C run-time library and other CRE resources able to
run in the user library space or system library space.
The module can be called from routines written in any language, regardless of
whether the routines run in the CRE. It is intended for system-level programming.
For additional considerations, see Section 9, System-Level Programming.
For the native C and C++ compilers, this option sets the _LIBSPACE feature-test
macro.
The pragma default settings are:
For each of the ENV pragma options, the compiler generates different code and
imposes different restrictions on which run-time library and language features can be
used. Table 13-2
summarizes the availability of run-time library and language features
for each ENV option.
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler ENV COMMON ENV COMMON
G-series TNS c89 utility ENV COMMON ENV COMMON
TNS/R native C and C++ compilers ENV COMMON ENV COMMON
Native c89 utility ENV COMMON ENV COMMON
TNS/E native C and C++ compilers ENV COMMON ENV COMMON
Table 13-2. ENV Options and the Availability of Run-Time Library and Language
Features (page1of2)
Feature COMMON EMBEDDED LIBRARY LIBSPACE
C I/O functions Yes No Yes * No
Memory allocation
functions
Yes No Yes No
*ENV LIBRARY permits the use of high-level language I/O facilities if direct access to relocatable
data blocks is not needed for the operations.