Technical data
Cray Standard C/C++ Reference Manual
3.5.3 duplicate Directive (Cray Standard C Compiler)
Scope: Global
The duplicate directive lets you provide additional, externally visible names
for specified functions. You can specify duplicate names for functions by using a
directive with one of the following forms:
#pragma _CRI duplicate actual as dupname...
#pragma _CRI duplicate actual as (dupname...)
The actual argument is the name of the actual function to which duplicate
names will be assigned. The dupname list contains the duplicate names that
will be assigned to the actual function. The dupname list may be optionally
parenthesized. The word, as, must appear as shown between the actual
argument and the comma-separated list of dupname arguments.
The duplicate directive can appear anywhere in the source file and it must
appear in global scope. The actual name specified on the directive line must be
defined somewhere in the source as an externally accessible function; the actual
function cannot have a static storage class.
The following example illustrates the use of the duplicate directive:
#include <complex.h>
extern void maxhits(void);
#pragma _CRI duplicate maxhits as count, quantity /* OK */
void maxhits(void)
{
#pragma _CRI duplicate maxhits as tempcount
/* Error: #pragma _CRI duplicate can’t appear in local scope */
}
double _Complex minhits;
#pragma _CRI duplicate minhits as lower_limit
/* Error: minhits is not declared as a function */
extern void derivspeed(void);
50 S–2179–36










