Subject: Re: C Language Standard(s)
To: None <current-users@NetBSD.ORG>
From: Simon J. Gerraty <sjg@zen.void.oz.au>
List: current-users
Date: 01/10/1996 07:57:36
> The __P has the definite down side that it looks ugly, 

But less ugly than 

#ifdef __STDC__
int foo(short x)
#else
int foo(x) short x;
#endif
{

> and that in some
> cases a compiler not-gcc may complain if the K&R style definition means
> a different thing than the prototype;

That just means that the prototype is wrong.

> int foo(short);

> int foo(x)
> 	short x;
> {
> ...
> }
> 
> is not happy for some compilers.

Any compiler that is happy with it is incorrect.  And yes I know of a
few DOS compilers that accept that (or at least used to some years ago
:-)

Any decent prototype generator would have given

int foo (int);

or 

int foo __P((int));

as the prototype.

If folk want to argue in favour of new-style function defintions then
rather than talking of unproto or whatever, think of porting gcc as
the first step in porting NetBSD.  That way you don't have to frob the
code for the initial compile...

--sjg