Hi,
I'm using a few day old RC_1_34_0 from cvs.
In boost\function\function_base.hpp I get a warning message that is
quite annoying so I went in to remove it.
The thing is I don't understand what it is complaining about.
It gives this warning message:
boost/function/function_base.hpp(287) : warning C4189: 'out_functor' :
local variable is initialized but not referenced
But the code is:
functor_type* out_functor =
reinterpret_cast
I'd like to chime in to increase the strength of the voice - I also get lots
of warnings from boost which I'd like to remove, in order to see the forest
for the trees. In my case, it is typically boost placeholders - _1, _2,
_3,... and the warning is about unused globals.
Is there a way we can get fixes for these and reduce the warnings coming
from boost?
Tony
On 10/9/06, Michael Marcin
Hi,
I'm using a few day old RC_1_34_0 from cvs.
In boost\function\function_base.hpp I get a warning message that is quite annoying so I went in to remove it.
The thing is I don't understand what it is complaining about. It gives this warning message:
boost/function/function_base.hpp(287) : warning C4189: 'out_functor' : local variable is initialized but not referenced
But the code is:
functor_type* out_functor = reinterpret_cast
(&out_buffer.data); // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. out_functor->~Functor(); which looks a lot like it is referencing out_functor to me.. can this warning be disabled
This warning shows up in several places like when compiling program options source. Although we don't have a strict 0 warning policy the simple line:
boost::signal< void () > g_signal;
generates a 83 line warning message for me which makes it much more difficult to glance at the output window and find helpful warnings.
Thanks,
Michael Marcin
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Gottlob Frege wrote:
I'd like to chime in to increase the strength of the voice - I also get lots of warnings from boost which I'd like to remove, in order to see the forest for the trees. In my case, it is typically boost placeholders - _1, _2, _3,... and the warning is about unused globals.
Is there a way we can get fixes for these and reduce the warnings coming from boost?
Posting specific details will be most helpful.
On 10/10/06, Peter Dimov
Gottlob Frege wrote:
I'd like to chime in to increase the strength of the voice - I also get lots of warnings from boost which I'd like to remove, in order to see the forest for the trees. In my case, it is typically boost placeholders - _1, _2, _3,... and the warning is about unused globals.
Is there a way we can get fixes for these and reduce the warnings coming from boost?
Posting specific details will be most helpful.
including boost/bind/placeholders.hpp into a cpp file, under Xcode 2.3 (gcc 4.0) gives you: warning: '<unnamed>::_2' defined but not used warning: '<unnamed>::_3' defined but not used ... all the way up to _9 (in my case _1 was being used). The fix we've used is to make an (unused) inline function that 'uses' the placeholders. Luckily it doesn't complain about unused functions (or more likely, that is just shut off?) Not sure what the best fix for that is. Tony
Gottlob Frege wrote:
On 10/10/06, Peter Dimov
wrote: Gottlob Frege wrote:
I'd like to chime in to increase the strength of the voice - I also get lots of warnings from boost which I'd like to remove, in order to see the forest for the trees. In my case, it is typically boost placeholders - _1, _2, _3,... and the warning is about unused globals.
Is there a way we can get fixes for these and reduce the warnings coming from boost?
Posting specific details will be most helpful.
including boost/bind/placeholders.hpp into a cpp file, under Xcode 2.3 (gcc 4.0) gives you:
warning: '<unnamed>::_2' defined but not used warning: '<unnamed>::_3' defined but not used ... all the way up to _9 (in my case _1 was being used).
g++ 3.x gave this warning for statics but not for unnamed namespace globals, it appears that they fixed it in 4. :-) You can try applying: http://boost.cvs.sourceforge.net/boost/boost/boost/bind/placeholders.hpp?r1=1.13&r2=1.14 This is a fix for a problem with g++ precompiled headers, but it should take care of the warning as well.
On 10/12/06, Peter Dimov
Gottlob Frege wrote:
On 10/10/06, Peter Dimov
wrote: Gottlob Frege wrote:
I'd like to chime in to increase the strength of the voice - I also get lots of warnings from boost which I'd like to remove, in order to see the forest for the trees. In my case, it is typically boost placeholders - _1, _2, _3,... and the warning is about unused globals.
Is there a way we can get fixes for these and reduce the warnings coming from boost?
Posting specific details will be most helpful.
including boost/bind/placeholders.hpp into a cpp file, under Xcode 2.3 (gcc 4.0) gives you:
warning: '<unnamed>::_2' defined but not used warning: '<unnamed>::_3' defined but not used ... all the way up to _9 (in my case _1 was being used).
g++ 3.x gave this warning for statics but not for unnamed namespace globals, it appears that they fixed it in 4. :-)
You can try applying:
http://boost.cvs.sourceforge.net/boost/boost/boost/bind/placeholders.hpp?r1=1.13&r2=1.14
This is a fix for a problem with g++ precompiled headers, but it should take care of the warning as well.
Yep that fixes the warning. Seems odd that gcc ends up with the same fix as borland (as they tend to be miles apart). Are there any downsides to the fix? Is it going to end up in an official release at some point? _______________________________________________
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Gottlob Frege wrote:
http://boost.cvs.sourceforge.net/boost/boost/boost/bind/placeholders.hpp?r1=1.13&r2=1.14
This is a fix for a problem with g++ precompiled headers, but it should take care of the warning as well.
Yep that fixes the warning. Seems odd that gcc ends up with the same fix as borland (as they tend to be miles apart). Are there any downsides to the fix? Is it going to end up in an official release at some point?
Borland has a similar problem with variables in precompiled headers. This isn't uncommon. There shouldn't be any downsides; bind supports both placeholder forms. The fix is already in 1.34.
Michael Marcin wrote:
Peter Dimov wrote:
Michael Marcin wrote:
<snip>
I don't know about the RC... it's probably a bit late for that.
There are lots more annoying warnings (just at warning level 3). I know many people work with a strict no warning policy.
Can you please post specific examples?
Sure, the first 2 come up quite often the rest are less bothersome.
boost/signals/trackable.hpp(185) : warning C4512: 'boost::signals::detail::bound_objects_visitor' : assignment operator could not be generated boost/signals/trackable.hpp(65) : see declaration of 'boost::signals::detail::bound_objects_visitor' ---------- boost/program_options/options_description.hpp(232) : warning C4512: 'boost::program_options::options_description' : assignment operator could not be generated boost/program_options/options_description.hpp(156) : see declaration of 'boost::program_options::options_description' ---------- program_options\cmdline.cpp(294) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) ---------- cmdline.cpp(465) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) ---------- boost\inc\boost/lexical_cast.hpp(138) : warning C4127: conditional expression is constant boost/lexical_cast.hpp(134) : while compiling class template member function 'boost::detail::lexical_stream
::lexical_stream(void)' with [ Target=std::string, Source=NewSource ] lexical_cast.hpp(219) : see reference to class template instantiation 'boost::detail::lexical_stream ' being compiled with [ Target=std::string, Source=NewSource ] value_semantic.hpp(190) : see reference to function template instantiation 'Target boost::lexical_caststd::string,T(const Source &)' being compiled with [ Target=std::string, T=bool, Source=bool ] value_semantic.hpp(188) : while compiling class template member function 'boost::program_options::typed_value<T> *boost::program_options::typed_value<T>::default_value(const T &)' with [ T=bool ] program_options\value_semantic.cpp(115) : see reference to class template instantiation 'boost::program_options::typed_value<T>' being compiled with [ T=bool ]
Saw the repost and thought the discussion was moving to devel... it seems to have continued on here so I'm reposting this here. Thanks, Michael Marcin
Michael Marcin wrote:
Hi,
I'm using a few day old RC_1_34_0 from cvs.
In boost\function\function_base.hpp I get a warning message that is quite annoying so I went in to remove it.
The thing is I don't understand what it is complaining about. It gives this warning message:
boost/function/function_base.hpp(287) : warning C4189: 'out_functor' : local variable is initialized but not referenced
But the code is:
functor_type* out_functor = reinterpret_cast
(&out_buffer.data); // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. out_functor->~Functor(); which looks a lot like it is referencing out_functor to me.. can this warning be disabled
I think that changing to
reinterpret_cast
Peter Dimov wrote:
Michael Marcin wrote:
Hi,
I'm using a few day old RC_1_34_0 from cvs.
In boost\function\function_base.hpp I get a warning message that is quite annoying so I went in to remove it.
The thing is I don't understand what it is complaining about. It gives this warning message:
boost/function/function_base.hpp(287) : warning C4189: 'out_functor' : local variable is initialized but not referenced
But the code is:
functor_type* out_functor = reinterpret_cast
(&out_buffer.data); // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. out_functor->~Functor(); which looks a lot like it is referencing out_functor to me.. can this warning be disabled
I think that changing to
reinterpret_cast
(&out_buffer.data)->~Functor(); can fix it.
Yes that removes the warning it'd be great if that could be patched into RC_1_34_0 & HEAD. There are lots more annoying warnings (just at warning level 3). I know many people work with a strict no warning policy. Are these things that are going to be addressed before 1.34 is released? Thanks, Michael Marcin
Michael Marcin wrote:
Peter Dimov wrote:
Michael Marcin wrote:
Hi,
I'm using a few day old RC_1_34_0 from cvs.
In boost\function\function_base.hpp I get a warning message that is quite annoying so I went in to remove it.
The thing is I don't understand what it is complaining about. It gives this warning message:
boost/function/function_base.hpp(287) : warning C4189: 'out_functor'
local variable is initialized but not referenced
But the code is:
functor_type* out_functor = reinterpret_cast
(&out_buffer.data); // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. out_functor->~Functor(); which looks a lot like it is referencing out_functor to me.. can this warning be disabled
I think that changing to
reinterpret_cast
(&out_buffer.data)->~Functor(); can fix it.
Yes that removes the warning it'd be great if that could be patched into RC_1_34_0 & HEAD.
I don't know about the RC... it's probably a bit late for that.
There are lots more annoying warnings (just at warning level 3). I know many people work with a strict no warning policy.
Can you please post specific examples?
Are these things that are going to be addressed before 1.34 is released?
My guess is that they won't. It ultimately depends on the release manager, though.
On Oct 10, 2006, at 8:39 PM, Michael Marcin wrote:
Peter Dimov wrote:
Michael Marcin wrote:
Hi,
I'm using a few day old RC_1_34_0 from cvs.
In boost\function\function_base.hpp I get a warning message that is quite annoying so I went in to remove it.
The thing is I don't understand what it is complaining about. It gives this warning message:
boost/function/function_base.hpp(287) : warning C4189: 'out_functor' : local variable is initialized but not referenced
But the code is:
functor_type* out_functor = reinterpret_cast
(&out_buffer.data); // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. out_functor->~Functor(); which looks a lot like it is referencing out_functor to me.. can this warning be disabled
I think that changing to
reinterpret_cast
(&out_buffer.data)->~Functor(); can fix it.
Yes that removes the warning it'd be great if that could be patched into RC_1_34_0 & HEAD.
Committed to both. If it causes any problems on RC_1_34_0, I'll back out this patch and using a #pragma warning disable instead. Doug
participants (5)
-
Doug Gregor
-
Gottlob Frege
-
Michael Marcin
-
Michael Marcin
-
Peter Dimov