Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 1997 10:48:48 -0400 (EDT)
From:      Tim Vanderhoek <hoek@hwcn.org>
To:        Igor <igor@blik.samara.su>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: question about kernel sources -- __P()
Message-ID:  <Pine.GSO.3.96.970710103414.19016A-100000@james.freenet.hamilton.on.ca>
In-Reply-To: <AASp9np8eH@blik.samara.su>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 10 Jul 1997, Igor wrote:

> in kernel sources files encounter next declaretion
> 
> int (*func)     __P((...))
>                 ^^^^^^^^^^
> what is this ?

grep -Ra '#define __P' /usr/include/*

returns a number of

net/ppp_defs.h:#define __P(x)   x
net/ppp_defs.h:#define __P(x)   ()

Vi'ing the file shows that the former is used in ISO C, but the
latter in non-ISO.  Reading stddef.h, it includes sys/cdefs.h.
Reading sys/cdefs.h, it gives an even better hint.  It's purpose
is to change ANSI prototypes,

ie.

int function (int, int, string *);

to K&R declarations,

int function ();


It's functionality is only marginally useful.  All future
compilers will handle ANSI prototypes, but in theory, it is
sometimes useful to make the system header files work in
retro-mode...

It's usefulness in the kernel is even more questionable...


--
Outnumbered?  Maybe.  Outspoken?  Never!
tIM...HOEk




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.96.970710103414.19016A-100000>