Boost logo

Boost :

Subject: Re: [boost] [accumulator] A lot of unused "parameter" warnings
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-10-02 09:59:42


Roland Bock-2 wrote:
>
> On 10/01/2011 08:51 PM, Vicente J. Botet Escriba wrote:
>> Le 01/10/11 20:03, Eric Niebler a écrit :
>>> On 10/1/2011 9:29 AM, Vicente J. Botet Escriba wrote:
>>>> Would you accept a patch that resolve them by commenting the
>>>> parameter name?
>>> Patches gladly accepted. Just open a ticket on svn.boost.org and
>>> attach the patch. Thanks!
>>>
>> Well, I have reached to remove the warnings in Boost.Parameter and
>> Boost.Fusion.
>>
>> The warnings in Boost.Accumulators are related to static variables
>> included in a unnamed namespace such as
>>
>> ../../../boost/accumulators/numeric/functional_fwd.hpp:187:38:
>> warning: unused variable 'min_assign' [-Wunused-variable]
>> extern op::min_assign const &min_assign;
>>
>> Unfortunately, I don't know how to silent these warnings :(
>>
>> Have you an idea how to silent them?
>>
>> Best,
>> Vicente
>>
>
> I had the same problem with some other library. I used the following
> method to silence the warnings (replaced namespaces):
>
> namespace boost
> {
> template<class T> void touch(const T&) {}
> }
>
> #define BOOST_TOUCH_FUNC(WHAT) \
> namespace\
> {\
> template<class T> void touch_WHAT()\
> { boost::touch(WHAT); }\
> }
>
> #define BOOST_TOUCH_VAL(WHAT) boost::touch(WHAT);
>
>
> If you find that useful, too, maybe it could be added to boost utility?
> There is similar stuff in some libraries, but none of it is documented, I
> think.
>
>

I'm not sure I understand. You mean that one way to silence extern variable
variables is to use them, isn't it?
Are you suggesting that I add this kind of code to my programs or that the
library author could add it on the files including extern declarations?
Can someone explain me why the compiler is warning on this case?

Best,
Vicente

--
View this message in context: http://boost.2283326.n4.nabble.com/accumulator-A-lot-of-unused-parameter-warnings-tp3863222p3865129.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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