Automatic Function Prototype Generation

Eelco van Asperen evas at euraiv1.UUCP
Wed Jul 27 23:40:18 AEST 1988


in article <306 at optilink.UUCP>, cramer at optilink.UUCP (Clayton Cramer) says:
> Microsoft C has an option /Zg for automatic generation of function 
> prototypes.  The theory is that you do something like:
> 
>         cl /Zg foo.c >foo.e
> 
> to generate a foo.e file to include in other modules that reference
> functions contained in foo.c.  This works.  The problem is make files.

I use the /Zg option only to convert existing programs; for each file
that exports functions, I create a header-file that contains relevant
declarations and the prototypes. This file is included in the file
itself to let the compiler check that the prototypes still match the 
current declarations and in the files that use the functions. Now, if
you change a function declaration and forget to update the header-file,
the compiler will complain that the prototype does not match the actual
declaration.


-- 
Eelco van Asperen.		
uucp:        evas at eurtrx / mcvax!eurtrx!evas	#include <inews/filler.h>
earn/bitnet: asperen at hroeur5			#include <stdjunk.h>
"We'ld like to know a little bit about you for our files" - Mrs.Robinson,	 Simon & Garfunkel



More information about the Comp.lang.c mailing list