protoize
The conversion programs protoize
and unprotoize
can
sometimes change a source file in a way that won't work unless you
rearrange it.
protoize
can insert references to a type name or type tag before
the definition, or in a file where they are not defined.
If this happens, compiler error messages should show you where the new references are, so fixing the file by hand is straightforward.
protoize
cannot figure out.
For example, it can't determine argument types for declaring a
pointer-to-function variable; this you must do by hand. protoize
inserts a comment containing `???
' each time it finds such a
variable; so you can find all such variables by searching for this
string. ANSI C does not require declaring the argument types of
pointer-to-function types.
unprotoize
can easily introduce bugs. If the program
relied on prototypes to bring about conversion of arguments, these
conversions will not take place in the program without prototypes.
One case in which you can be sure unprotoize
is safe is when
you are removing prototypes that were made with protoize
; if
the program worked before without any prototypes, it will work again
without them.
You can find all the places where this problem might occur by compiling
the program with the `-Wconversion
' option. It prints a warning
whenever an argument is converted.
protoize
cannot get the argument types for a function whose
definition was not actually compiled due to preprocessor conditionals.
When this happens, protoize
changes nothing in regard to such
a function. protoize
tries to detect such instances and warn
about them.
You can generally work around this problem by using protoize
step
by step, each time specifying a different set of `-D
' options for
compilation, until all of the functions have been converted. There is
no automatic way to verify that you have got them all, however.
If you plan on converting source files which contain such code, it is recommended that you first make sure that each conditionally compiled region of source code which contains an alternative function header also contains at least one additional follower token (past the final right parenthesis of the function header). This should circumvent the problem.
unprotoize
can become confused when trying to convert a function
definition or declaration which contains a declaration for a
pointer-to-function formal argument which has the same name as the
function being defined or declared. We recommand you avoid such choices
of formal parameter names.