extern/static in same file

Tom Roberts tjr at ihnet.UUCP
Wed Apr 4 02:13:24 AEST 1984


There has been a query about declaring a function extern, and
then defining it static, in the same file. The specific question was
"are there any C compilers that do not allow this?".

YES!

C/80 from the Software Toolworks (for the 8080/Z80 running CP/M)
will not allow:

	main()
	{
		extern fun();
		...
	}
	static fun()
	{
		...
	}


This works:

	static fun();

	main()
	{
		...
	}
	static fun()
	{
		...
	}


[C/80 is a small, cheap ($50) C-compiler for a small system (CP/M). It is
quite useful, in spite of its quirks]


		Tom Roberts
		ihnp4!ihnet!tjr



More information about the Comp.unix.wizards mailing list