I need to create ANSI C function prototypes.

Lloyd Zusman ljz at fxgrp.UUCP
Wed Feb 3 05:55:14 AEST 1988


I'm looking for a program that will take old-fashioned C code and
produce ANSI C function prototypes.

For example, consider the following program fragment ...

	char *foo(a, b, c)
	char *c;
	int b;
	{ ... }

	int bar(x, y)
	struct bonzo *x;
	MYTYPE *y;
	{ ... }

This program would produce something similar to the following:

	char *foo(char *a, int b, int c);

	int bar(struct bonzo *x, MYTYPE *y);

Musts:
------

(1) This program must run under unix.

(2) It mustn't alter the original source file, but must write its
    output to stdout, another file, etc.

(3) Notice that there is no explicit declaration for the 'c' argument
    in the foo() function in the above example, and hence the argument
    defaults to an 'int'.  The program must handle this case.

I know that there are C compilers that run under MSDOS which optionally
do this sort of thing, but these programs would violate "must" number 1.

It also would be nice if source code were available.

Any suggestions?


---
    Lloyd Zusman
    Master Byte Software
    Los Gatos, California		Internet:   fxgrp!ljz at ames.arpa
    "We take things well in hand."	UUCP:	    ...!ames!fxgrp!ljz



More information about the Comp.unix.questions mailing list