Boost logo

Boost :

From: Paul Giaccone (paulg_at_[hidden])
Date: 2006-06-27 09:42:40


Reece Dunn wrote:

>Oliver Kullman wrote:
>
>
>>>NOTE: Instead of disabling the warnings, you can remove the warning by
>>>updating the code. For example:
>>>
>>>void foo( int bar ){} // unreferenced parameter
>>>void foo( int bar ){ bar; } // no warning!
>>>
>>>
>>>
>>this is FALSE:
>>
>>
>
>No - it is one way to prevent the bug.
>
>
>
>>void foo(int){}
>>
>>
>
>This doesn't work if you have:
>
>/** @brief something
> * @param bar Oh dear, this is missing!
> */
>void foo( int bar ){}
>
>Either not specifying bar or commenting it out will mean that Doxygen will not
>be able to identify the bar parameter.
>
>
Assuming "bar" is used inside an #ifdef...#endif block, then you can write:

void foo(int
#ifdef XYZ
bar
#endif
)
{
//some code
#ifdef XYZ
//do something with bar
#endif
}

This is rather messy, but if you really want to stop that compiler
warning, it works.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk