Option Type | Default Value | #pragma options | C | C++ |
-qoption | nogenproto | - | x |
Syntax
-qgenproto | -qgenproto=parmnames | -qnogenproto
Purpose
Produces ANSI prototypes from K&R function definitions. This
should help to ease the transition from K&R to ANSI.
Notes
Using -qgenproto without PARMnames
will cause prototypes to be generated without parameter names.
Parameter names are included in the prototype when PARMnames
is specified.
Example
For the following function, foo.c:
foo(a,b,c) float a; int *b;
specifying
xlC -c -qgenproto foo.c
produces
int foo(double, int*, int);
The parameter names are dropped. On the other hand, specifying
xlC -c -qgenproto=parm foo.c
produces
int foo(double a, int* b, int c);
In this case the parameter names are kept.
Note that float a is represented as double or double a in the prototype, since ANSI states that all narrow-type arguments (such as chars, shorts, and floats) are widened before they are passed to K&R functions.
List of Compiler Options and Their
Defaults
Options that Specify Compiler
Characteristics