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 -111
VERSION3
Wversion3 flag when specifying c89 in the OSS environment. You cannot enter
the VERSION3 directive in the source file.
VERSION3 is the default version of the native C++ compiler for the G06.20 RVU
and for subsequent RVUs until a new version of the compiler is released.
If you specify no version directive (or if you include the VERSION3 directive) with
the G06.20 native C++ compiler, you will produce a binary that is compatible with
binaries produced by the G06.20 compiler but not the D45 compiler (VERSION2) or
any earlier compiler.
The VERSION3 directive specifies the use of the Standard C++ Library ISO/IEC
version 3, and the C++ Standard headers. VERSION3 enforces the ISO/IEC IS
14882:1998 standard for C++. The ISO C++ standard is identical to the ANSI C++
standard. The VERSION3 Standard C++ Library ISO/IEC is combined with the C++
run-time library into one public SRL (named ZSTLSRL) on NonStop S-series
systems but is separated into three component libraries (ZCPPCDLL, ZCPP2DLL,
and ZCPP3DLL) on NonStop NS-series systems to implement the
BUILD_NEUTRAL_LIBRARY pragma.
For more details about the VERSION3 Standard C++ Library, see the Standard C++
Library Reference ISO/IEC (VERSION3) on the product documentation CD, the HP
NonStop Technical Library (NTL).
VERSION3 supports IEEE floating-point format.
VERSION3 supports DLLs (Dynamic-Link Libraries) and Position-Independent
Code (PIC).
VERSION3 does not support any version of the Tools.h++ library.
All modules of an application must be built using the same version of the Standard
C++ Library. For example, you must compile all modules using the same version
directive (VERSION1, VERSION2, or VERSION3). Mixing versions within an
application can cause unpredictable results.
Beginning at G06.20, the native linkers enforce non-mixing of versions. The ld
and nld linkers issue a warning if you attempt to link modules compiled with
VERSION1 and VERSION2. An error is issued by nld if VERSION3 is mixed with
either VERSION1 or VERSION2. In addition, eld and ld issue an error on any
VERSION1 linkfile in addition to any mixing of VERSION2 with VERSION3.
You can build a neutral C++ dialect DLL using the BUILD_NEUTRAL_LIBRARY
pragma.
You can disable version checking by designating a loadfile CPPNEUTRAL using a
linker. You can also display the C++ version of a loadfile by using the
LISTATTRIBUTES command of enoft or noft. For more details, see the:
°
eld Manual
°
enoft Manual
°
ld Manual