proto

proto(1) converts ANSI C prototype constructs to constructs compatible with K&R C, ANSI C, and C++. Only files with the line
     #pragma prototyped
in the first 64 lines are processed; other files are silently ignored. This is how ast source is first shipped to foreign architectures. Once ast is bootstrapped the non-proto source can be built using the ast tools.

proto also converts in the other direction by providing extern prototypes for a collection of K&R source files and by converting K&R source files in place. K&R to ANSI is not 100%, but is a good starting point for manual conversion.

proto is token based (no C grammar); this allows it to convert before C preprocessing, and also allows proto to be inserted into the standalone cpp. This is how nmake compiles ANSI C source with K&R compilers.


Glenn Fowler
Information and Software Systems Research
AT&T Labs Research
Florham Park NJ
September 16, 1999