ANSI prototypes, the right choice...

Doug Gwyn gwyn at smoke.brl.mil
Wed Feb 6 07:16:00 AEST 1991


In article <7708 at sugar.hackercorp.com> peter at sugar.hackercorp.com (Peter da Silva) writes:
>	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.

No, this is perfectly okay.  If Lattice C has a problem with it, it is a
bug in Lattice C.

There ARE function interfaces where the "old style" definition would not
be compatible with a prototype using the same types, but only when default
argument promotions change the type, which is not the case for int.



More information about the Comp.std.c mailing list