*BSD News Article 55519


Return to BSD News archive

Newsgroups: comp.unix.bsd.netbsd.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!chi-news.cic.net!newsfeed.internetmci.com!in1.uu.net!deshaw.com!christos
From: christos@deshaw.com (Christos Zoulas)
Subject: Re: What is __P() for?
Message-ID: <DIs1rJ.GMz@deshaw.com>
Sender: usenet@deshaw.com
Nntp-Posting-Host: es2
Organization: D. E. Shaw & Co.
References: <498eac$2gm@taco.cc.ncsu.edu>
Date: Tue, 28 Nov 1995 23:40:30 GMT
Lines: 26

In article <498eac$2gm@taco.cc.ncsu.edu> kpneal@eos.ncsu.edu (Kevin P. Neal) writes:
>What is the purpose of this:
>
>int __P(functname(int arg)); 
>
>(Did I do that right?) What is the point? Doesn't it just
>get converted by the preprocessor into (funct...) anyway?
>
>I think this has something to do with ANSI C, but what is the
>story behind it?
>

I'll answer this one, but please in the future poke a bit around before
you ask... You should look for it's #define definition in /usr/include:

In <sys/cdefs.h> it says:

#if defined(__STDC__) || defined(__cplusplus)
#define __P(protos)     protos          /* full-blown ANSI C */
  ...
#else   /* !(__STDC__ || __cplusplus) */
#define __P(protos)     ()              /* traditional C preprocessor */
  ...
#endif

christos