Automatic Function Prototype Generation

Don Kneller kneller at cgl.ucsf.edu
Tue Aug 2 08:25:12 AEST 1988


In article <306 at optilink.UUCP> cramer at optilink.UUCP (Clayton Cramer) writes:
>Microsoft C has an option /Zg for automatic generation of function 
>prototypes.
>
>[ In makefiles ] this works (clumsily), but there are two problems:
>
>1. If you change a function definition in foo.c, and you have included
>foo.e in foo.c, you will get complaints that will prevent a compile
>from happening, and prevent a new foo.e from being produced.

You can turn off the old prototypes with a conditional directive.
Your .c.e rule can look like:

.c.e:
    echo #ifndef NOPROTOTYPES > $*.tmp
    cl -AL -c -Zg -DNOPROTOTYPES $*.c >> $*.tmp
    echo #endif >> $*.tmp
    updexh $*.tmp $*.e

-----
	Don Kneller
UUCP:		...ucbvax!ucsfcgl!kneller
INTERNET:	kneller at cgl.ucsf.edu
BITNET:		kneller at ucsfcgl.BITNET



More information about the Comp.lang.c mailing list