*BSD News Article 55567


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!news.kei.com!uhog.mit.edu!uw-beaver!news.u.washington.edu!news.alt.net!news.serv.net!solaris.cc.vt.edu!briggs
From: briggs@puma.bevd.blacksburg.va.us (Allen Briggs)
Newsgroups: comp.unix.bsd.netbsd.misc
Subject: Re: What is __P() for?
Date: 28 Nov 1995 13:49:21 GMT
Organization: Home, Blacksburg, Virginia
Lines: 28
Message-ID: <49f411$1s3@solaris.cc.vt.edu>
References: <498eac$2gm@taco.cc.ncsu.edu>
NNTP-Posting-Host: puma.bevd.blacksburg.va.us
NNTP-Posting-User: briggs

In article <498eac$2gm@taco.cc.ncsu.edu>,
Kevin P. Neal <kpneal@eos.ncsu.edu> wrote:
>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?

It's actually:
int  functname __P((int arg));

It's used to support ANSI function prototypes on systems that can handle
it, and to not blow up on systems that don't.  For ANSI C systems, that
will expand to:
int  functname (int arg);

And for non-ANSI:
int  functname ();

Believe it or not, some systems still don't ship with ANSI C compilers,
although GNU is almost always an option....

-allen

-- 
Allen Briggs - end killing - allen.briggs@bev.net ** MacBSD == NetBSD/mac68k **
   Where does all my time go?  <a href="http://www.netbsd.org/">Guess.</a>