Re: [code] typedef problem

From: Erwin S. Andreasen (erwin@PIP.DKNET.DK)
Date: 08/31/97


On Sun, 31 Aug 1997, Brian Gray wrote:

> C++ is pickier than C.
[...]
> put a dummy int in the prototype and you should be ok.  If you get an
> unused parameter warning just put the variable in the following macro:
>
> #define UNUSED(x) ((x)=(x))

Actually, you can leave out the argument name in the function definition
to tell the compiler that it is intentional that this argument is unused.
I *think* it's a standard C++ thing, and not a gcc extension, but I am
unable to find any references to it in Stroustrup's book currently:

void my_handler (int) // Parameter is not used
{
}

This does not apply to C.



 =============================================================================
Erwin Andreasen   Herlev, Denmark <erwin@pip.dknet.dk>  UNIX System Programmer
<URL:http://pip.dknet.dk/~erwin/>         <*>           (not speaking for) DDE
 =============================================================================


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST