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

Storage Class Specifier
The _lowmem and export-attribute storage-class specifiers are HP extensions.
storage-class-specifier is one of:
typedef
extern
static
auto
register
export-attribute
_lowmem
typedef, extern, static, auto, and register
are described in the ISO/ANSI C standard.
_lowmem
specifies that arrays and structures in the declaration are to be stored in the user data space
instead of the extended segment (only for TNS C and C++). Consequently, _lowmem is useful
only when compiling for the large-memory model or the wide-data model. Note that you can
use _lowmem alone, or you can specify it after the auto, extern, or static storage-class specifiers.
The _lowmem storage class specifier is applicable only in the TNS environment. In the native
environment, _lowmem has no effect on code generation or the storage of objects. It is supported
to allow source-level compatibility with TNS C and C++. Source-level compatibility involves
only accepting syntactically correct TNS programs, not diagnosing semantic violations with
_lowmem usage.
Usage Guidelines for _lowmem
_lowmem cannot be used with the register storage-class specifier or with the _cspace
type qualifier.
_lowmem cannot be used with a formal parameter declaration or a function declaration.
_lowmem cannot be used with a class or struct member unless the member is static.
If you specify only _lowmem, the default storage classes apply:
Variables declared within function bodies and variables declared within blocks have the
default storage class auto.
Variables defined outside of a function have the default storage class extern.
Functions have the default storage class extern.
Examples
This example shows how _lowmem affects allocation of data storage using the large-memory
model:
#pragma XMEM
static int x[5000];
static _lowmem int m[1000];
_lowmem struct triplet
{
int x,y,z;
} t1;
The pragma XMEM specifies compilation for the large-memory model. Therefore, storage for the
array x is allocated in the extended segment. However, because the declarations for the array m
50 C and C++ Extensions