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

Table Of Contents
C and C++ Extensions
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
2-9
Declarations
/* D40 method */
if (_status_lt(cc)) {
...
} else if (_status_gt(cc)) {
...
}
Type Qualifier
The _cspace type qualifier is an HP extension. The _cspace type qualifier is
applicable only in the TNS Guardian environment. _cspace is unnecessary in the
native environment; however the native compilers recognize the _cspace keyword to
provide source-level compatibility with the TNS compiler. Source-level compatibility
involves only accepting syntactically correct TNS programs, not diagnosing semantic
violations with _cspace usage.
const
is described in the ISO/ANSI C standard.
_cspace
indicates that the specified constant is stored in the current code space (only for
TNS C and C++). The _cspace type qualifier must be accompanied by the const
type qualifier. For more details on the use of the _cspace type qualifier, see
Section 9, System-Level Programming.
volatile
In the ISO/ANSI C standard, if a variable is declared with the
volatile type
qualifier, the variable can be modified by an agent external to the program. The
architecture of HP NonStop systems does not support external modifications to
variables by agents external to the program. For compatibility with the ISO/ANSI
C standard, HP defines
volatile to mean:
For the TNS C compiler and the TNS C++ preprocessor, the volatile type
qualifier is accepted and ignored.
For the native C and C++ compilers, if a variable is qualified with the volatile
type qualifier, this means that loads and stores of this variable must access
memory, not a register.
For TNS C++, you cannot use volatile to distinguish specific instances of
overloaded member functions.
type-qualifier
const | _cspace | volatile