-qppsuborigarg

Category

Input control

@PROCESS

None.

Purpose

Instructs the C preprocessor to substitute original macro arguments before further macro expansion.

Syntax

Read syntax diagramSkip visual syntax diagram
                 .-noppsuborigarg-.   
>>- -WF--,-- -q--+-ppsuborigarg---+----------------------------><

Defaults

Usage

-qppsuborigarg is a C preprocessor option, and must therefore be specified using the -WF option.

Examples

Consider the following sample code, x.F:
#define PRINT_COMP(a) PRINT_4(SPLIT_COMP(a))
#define SPLIT_COMP(a) "Real:", real(a), "Imag:", imag(a)
#define PRINT_4(list) PRINT_LIST(list)
#define PRINT_LIST(list) print *, list

complex a
a = (3.5, -3.5)
PRINT_COMP(a)
end
If this code is compiled with -qnoppsuborigarg, the C preprocessor reports an error because the parameter "list" in the function-like macro PRINT_4 is the expanded substitution text of the macro SPLIT_COMP(a). The C preprocessor therefore complains because PRINT_LIST is being called with four arguments but only expects one.
> xlf95 x.F -d
"x.F", line 8.1: 1506-215 (E) Too many arguments specified for macro PRINT_LIST.
** _main   === End of Compilation 1 ===
1501-510  Compilation successful for file x.F.
> cat Fx.f

complex a
a = (3.5, -3.5)
print *, "Real:"
end
When the code is compiled with -qppsuborigarg, the C preprocessor uses the text "SPLIT_COMP(a)" rather than the expanded substitution text of SPLIT_COMP(a) as the argument to the function-like macro PRINT_LIST. Only after the macro PRINT_LIST has been expanded, does the C preprocessor proceed to expand the macro "SPLIT_COMP(a)". As a result, the macro PRINT_LIST only receives the expected single argument "SPLIT_COMP(a)" rather than the four arguments.
> xlf95 x.F -d -WF,-qppsuborigarg
** _main   === End of Compilation 1 ===
1501-510  Compilation successful for file x.F.
> cat Fx.f

complex a
a = (3.5, -3.5)
print *, "Real:", real(a), "Imag:", imag(a)
end

Related information