__ in c

D

dhilipkumarg

Hi,
while going through some code, i ve seen something like
..
..
n=fun(i,j);
..
..
..
the definition of fun exists as
..
..
int fun __P(int, int);
..
..
may i know what is the meaning of this statement??????
will u please help me or atleast send me the link where i can avail the
information about this __ statements.

thanku.
 
W

Walter Roberson

while going through some code, i ve seen something like
n=fun(i,j);
the definition of fun exists as
int fun __P(int, int);
may i know what is the meaning of this statement??????

There is no standard semantics for that statement.

There is no standard function or macro named __P
will u please help me or atleast send me the link where i can avail the
information about this __ statements.

You need to read it more carefully: it is not __ but rather __P .
So you should search through the header files until you find
__P defined.

Chances are what you will find is a conditional test
that evaluates some criteria to decide whether function
prototypes are allowed (and/or desired), and that in
the case where they are -not- desired, that __P is #define'd
as a macro that expands to nothing at all (thus causing it
and it's arguments to vanish.)

In the case where prototypes are desireable and possible,
__P is likely something like

#define __P(type1,type2) (type1,type2)

When expanded in the context you show,

int fun __P(int,int)

it would lead the line to be expanded to

int fun (int,int)

which is a standard prototyped definition for a function.


Above I showed __P as having two arguments. If the code is
intended for use with gcc or C99, then more likely it is
defined using varadic macros, so that it can take any
number of arguments.
 
C

CBFalconer

Thank u for ur help.
i ll go through the code.......

Friendly tip - don't use abbreviations in usenet - 'u' and 'ur' are
hard to read and offensive to many. Do quote sufficient context
from whatever you are replying to (see my sig below if you really
must use the foul google interface), and do not top-post. Your
answer belongs after the quoted (and snipped of irrelevant
portions) material.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top