C/C++ Programmer's Guide (G06.25+)
C and C++ Extensions
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
2-15
Pointer Modifiers
Usage Guidelines for Attribute-Specifier Syntax
•
The FUNCTION pragma is the preferred method for declaring external routines. For 
details, see pragma FUNCTION on page 13-36 and Writing Interface Declarations 
on page 7-3.
•
Programs that use this attribute-specifier syntax can be made portable by 
using macro definitions in which the attribute-specifier keywords are 
replaced by nothing.
Examples
The following function declaration declares a C or C++ function myproc, which is a 
TAL variable procedure with the externally visible procedure name My^Proc:
 _tal _variable _alias ("My^Proc") void myproc (short);
The following example declares a function pointer pointing to a TAL integer extensible 
procedure:
_tal _extensible short (*tal_func_ptr)(void);
Pointer Modifiers
The _baddr, _far, _near, _procaddr, and _waddr pointer modifiers are HP 
extensions. They have been added to TNS C and C++ because the TNS architecture 
has many pointer types, and it is necessary that you have a way to designate what 
type of pointer is desired. For native C and C++, these pointer modifiers have no effect. 
They are added to provide source-level compatibility with TNS C and C++. Source-
level compatibility involves only accepting syntactically correct TNS programs, not 
diagnosing semantic violations with pointer modifier usage.
Pointer for C Programming Language
type-qualifier-list is described in the ISO/ANSI C standard.
pointer:
 [ modifier-list ] * [ type-qualifier-list ]
 [ modifier-list ] * [ type-qualifier-list ] pointer
modifier-list:
 modifier [ modifier-list ]
modifier:
 _far | _near | _baddr | _waddr | _procaddr 










