From owner-freebsd-hackers Thu Jul 10 07:48:09 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id HAA05403 for hackers-outgoing; Thu, 10 Jul 1997 07:48:09 -0700 (PDT) Received: from hwcn.org (main.hwcn.org [199.212.94.65]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id HAA05395 for ; Thu, 10 Jul 1997 07:48:07 -0700 (PDT) Received: from james.freenet.hamilton.on.ca (ac199@james.hwcn.org [199.212.94.66]) by hwcn.org (8.8.6/8.8.6) with ESMTP id KAA27117; Thu, 10 Jul 1997 10:48:34 -0400 (EDT) Received: from localhost (ac199@localhost) by james.freenet.hamilton.on.ca (8.8.6/8.8.6) with SMTP id KAA21825; Thu, 10 Jul 1997 10:48:49 -0400 (EDT) X-Authentication-Warning: james.freenet.hamilton.on.ca: ac199 owned process doing -bs Date: Thu, 10 Jul 1997 10:48:48 -0400 (EDT) From: Tim Vanderhoek X-Sender: ac199@james.freenet.hamilton.on.ca Reply-To: hoek@hwcn.org To: Igor cc: hackers@FreeBSD.ORG Subject: Re: question about kernel sources -- __P() In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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