#pragma complexgcc

Applies to C Applies to C++

Description

The #pragma complexgcc directive instructs the compiler how to pass parameters when calling complex math functions.

Syntax


Syntax Diagram

where suboptions do the following:


on Pushes -qfloat=complexgcc onto the stack. This instructs the compiler to use GCC conventions when passing and returning complex parameters.
off Pushes -qfloat=nocomplexgcc onto the stack. This instructs the compiler to use AIX conventions when passing and returning complex parameters.
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 References

General Purpose Pragmas
complexgccincl
float IBM Copyright 2003