ANSI C Prototyping Question

Scott Barman scott at nastar.UUCP
Tue Nov 28 10:14:19 AEST 1989


(I hope I word this correctly :-)

Does ANSI C require a prototype for every function used within a file?
For example, if in main.c I know I can do (assuming all the #includes
are entered first):

	void intrhandlr(sig)
	{
		... code ...
	}

	void main(void)
	{
		... code ...
		signal(SIGINT,intrhandlr);

		... more code ...
		junk(x);
	}

And junk is in another file (e.g. junk.c).  Do I have to include the
line
	extern void junk(int x);

in the main.c file?

I'm sure this has been debated on the net before--along with its "religious"
implications.  Please email me the reply to keep net traffic down to a dull
roar!  Thanks!!!!

-- 
scott barman
{gatech, emory}!nastar!scott



More information about the Comp.lang.c mailing list