Help! function declare.

A

August Karlstrom

Raymond said:
Hello All:
I have find a function declaration like following:

`_' must be a macro function

#define _(x) ...

called with argument `(GTRID *, long)'. Without its definition it's hard
to say what happens.


-- August
 
M

Martin Ambuhl

Raymond said:
Hello All:
I have find a function declaration like following:

First, you need to find out what the macro _() is.
That macro has no standard meaning, so it should be available in the
included non-standard headers. Of course, we can all guess what it is:
a macro designed to make the declaration work whether the implementation
can handle prototypes or not. This sort of hack should disappear soon,
since it has been 16 years since the C standard mandated that prototypes
be supported.

So, assume that _(x) expands to x
We now have
extern int _ts_callback_abort (GTRID *, long);

This is the declaration for an implementation-specific function which is
part of the implementation, since no one else can use such a name for a
function. It takes two arguments, one a pointer to a variable of an
unknown non-standard type GTRID, the other a long. That makes *two*
needed definitions you failed to give us (the macro _() and the type
GTRID). The function returns an int, and has external linkage.
 
P

pete

Raymond said:
Hello All:
I have find a function declaration like following:

That's a declaration.
Declarations and statements are two dfifferent things.
The body of a C89 function definition contains
declarations followed by statements.
A translation unit consists of external declarations.
 

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

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top