>>-#--pragma--argument------------------------------------------> >--(--function_name--+-,--OS--+------------+---+--)------------>< | '-,--nowiden-' | +-,--VREF--+------------+-+ | '-,--nowiden-' | '-,--nowiden--------------'
Description
Specifies the argument passing and receiving mechanism to be used for the procedure or typedef named by function_name.
This pragma identifies procedures as externally bound-procedures only. The procedure may be defined in and called from the same source as the pragma argument directive. If the pragma argument directive is specified in the same compilation unit as the definition of the procedure named in that directive, the arguments to that procedure will be received using the method specified in that pragma directive.
For information on making calls to external programs, see pragma linkage .
Parameters
Notes on Usage
This pragma controls how parameters are passed to bound-procedures and how they are received. The function name specified in the #pragma argument directive can be defined in the current compilation unit. The #pragma argument directive must precede the function it names.
Specifying a #pragma argument directive in the same compilation unit as the affected procedure tells the compiler that the procedure is to receive (as well as to send) its arguments as specified in the pragma argument directive. This is useful for ILE C written bound-procedures specified in a pragma argument. The user must ensure that if the call to the procedure and the definition are in separate compilation units, the pragma argument directives must match in regards to their passing method ( OS, VREF, and nowiden).
For example, in the two source files below, the address of a temporary copy
of the argument will be passed to foo in Program 1. Program
2, foo will receive the address of the temporary copy, dereference
it, and assign that value to the parameter a. If the two
pragma directives differ, behavior is undefined.
Program 1 | Program 2 |
#pragma argument( foo, OS, nowiden) void foo(char); void main() { foo(10); } |
#pragma argument( foo, OS, nowiden ) void foo( char a ) { a++; } |
Warnings are issued, and the #pragma argument directive is ignored if any of the following occurs:
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.