ANSI prototypes, the right choice...

Peter da Silva peter at sugar.hackercorp.com
Wed Feb 13 21:51:47 AEST 1991


In article <1991Feb11.164636.22675 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
> How curious; an ANSI-conforming compiler has to accept mixtures.  Given
> some attention to parameter types, a program which prototypes a function and
> then gives an old-style definition of it is completely, 100% ANSI-conforming,
> and any compiler which refuses to accept it is not.

I think the key here is the phrase "Given some attention to parameter types".

That is, "int foo(int, int);" is compatible with "int foo(a, b) char a, b;",
but "int foo(char, char);" isn't. A compiler that accepts the latter as
compatible with a non-prototyped definition without so much as a warning
isn't ANSI compliant, no?

And it's that usage that's causing the problem.
-- 
Peter da Silva.   `-_-'
<peter at sugar.hackercorp.com>.



More information about the Comp.std.c mailing list