ANSI prototypes, the right choice...

Peter da Silva peter at sugar.hackercorp.com
Tue Feb 5 11:53:51 AEST 1991


For all you Lattice-C programmers, I have a little hint for writing more
portable programs:

	int foo(int a, int b);

This is *not* compatible with a function declared:

	int foo(a, b)
	int a, b;
	{
		...
	}

While some compilers will accept this declaration while this prototype is
in scope, it is not portable and should at least generate a warning. If you
use a prototype, *declare* it with a prototype. If you don't want to, then
leave the prototype out as well.
-- 
Peter da Silva.   `-_-'
<peter at sugar.hackercorp.com>.



More information about the Comp.std.c mailing list