Simple function_template.hpp warning fix

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Simple function_template.hpp warning fix

Peter Dimov
Line 293:

        void init(FunctionPtr f, function_ptr_tag)

needs to be changed to:

        void init(FunctionPtr /*f*/, function_ptr_tag)

to silence the "unreferenced formal parameter" warning. OK to commit?

--
Peter Dimov
http://www.pdimov.com
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Simple function_template.hpp warning fix

Doug Gregor-2

On Mar 2, 2006, at 8:39 AM, Peter Dimov wrote:

> Line 293:
>
>         void init(FunctionPtr f, function_ptr_tag)
>
> needs to be changed to:
>
>         void init(FunctionPtr /*f*/, function_ptr_tag)
>
> to silence the "unreferenced formal parameter" warning. OK to commit?

Yes, go ahead.

        Doug

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Simple function_template.hpp warning fix

Peter Dimov
Doug Gregor wrote:

> On Mar 2, 2006, at 8:39 AM, Peter Dimov wrote:
>
>> Line 293:
>>
>>         void init(FunctionPtr f, function_ptr_tag)
>>
>> needs to be changed to:
>>
>>         void init(FunctionPtr /*f*/, function_ptr_tag)
>>
>> to silence the "unreferenced formal parameter" warning. OK to commit?
>
> Yes, go ahead.

Done; there are two more warnings, one at function_template.hpp:141,
"conditional expression is constant", and one at function_base.hpp:287,
"local variable initialized but not referenced". These are harder to fix.
Should we #pragma them away?

The function_base one can be avoided by replacing

            functor_type* out_functor =
              reinterpret_cast<functor_type*>(&out_buffer.data);
            // Some compilers (Borland, vc6, ...) are unhappy with
~functor_type.
            out_functor->~Functor();

with

            // Some compilers (Borland, vc6, ...) are unhappy with
~functor_type.
            reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor();

at some readability cost.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost