#pragma complexgcc

Description

The #pragma complexgcc directive instructs the compiler how to pass and return parameters of complex type.

Syntax

Read syntax diagramSkip visual syntax diagram>>-#--pragma--complexgcc--(--+-on--+--)------------------------><
                             +-off-+
                             '-pop-'
 

where suboptions do the following:

on Pushes -qfloat=complexgcc onto the stack. This instructs the compiler to use the GCC conventions for passing and returning parameters of complex type, by using general purpose registers.
off Pushes -qfloat=nocomplexgcc onto the stack. This instructs the compiler to use AIX conventions for passing and returning parameters of complex type, by using floating-point registers.
pop Removes the current setting from the stack, and restores the previous setting. If the stack is empty, the compiler will assume the -qfloat=[no]complexgcc setting specified on the command line, or if not specified, the compiler default for -qfloat=[no]complexgcc.

Notes

The current setting of this pragma affects only functions declared or defined while the setting is in effect. It does not affect other functions.

Calling functions through pointers to functions will always use the convention set by the -qfloat=[no]complexgcc compiler option. If this option is not explicitly set on the command line when invoking the compiler, the compiler default for this option is used. An error will result if you mix and match functions that pass complex values by value or return complex values.

For example, assume the following code is compiled with -qfloat=nocomplexgcc:

#pragma complexgcc(on) 
void p (_Complex double x) {} 

#pragma complexgcc(pop) 
typedef void (*fcnptr) (_Complex double); 

int main() { 
    fcnptr ptr = p;	/* error: function pointer is -qfloat=nocomplexgcc; 
                              function is -qfloat=complexgcc */ 
}

Related information