C/C++ Programmer's Guide (G06.25+)
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
13-106
VERSION2
VERSION2
The VERSION2 pragma is a command-line directive for native mode C++ that instructs
the C++ compiler to compile using the dialect or features available beginning with the
D45 version of the HP C++ language. This pragma is not accepted by the TNS
compilers.
The pragma default settings are:
Usage Guidelines
•
You can enter the VERSION2 directive on the compiler RUN command line when
specifying NMCPLUS or CPPCOMP on Guardian, or using the -Wversion2 flag
when specifying c89 in the OSS environment. You cannot enter the VERSION2
directive in the source file.
•
VERSION2 supports DLLs (Dynamic-Link Libraries) and Position-Independent
Code (PIC).
•
Using the VERSION2 directive enables you to use the following language features
of the native C++ compiler:
°
Exception handling
°
Namespaces
°
The bool type
°
The wchar_t type
°
Array new and delete
°
Run-time type identification (RTTI)
°
New-style casts (static_cast, reinterpret_cast, and const_cast)
°
Explicit instantiation of templates
°
Support of partial specialization of templates
°
Support of extern inline functions
°
enum types are considered to be nonintegral types
VERSION2
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler N.A. N.A.
G-series TNS c89 utility N.A. N.A.
TNS/R native C and C++ compilers VERSION3 for C++,
N.A. for C
VERSION3 for C++,
N.A. for C
Native c89 utility VERSION3 for C++,
N.A. for C
VERSION3 for C++,
N.A. for C
TNS/E native C and C++ compilers VERSION3 for C++,
N.A. for C
VERSION3 for C++,
N.A. for C