-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress boost warnings about global placeholders #3147
Conversation
When building Gazebo, my build log is spammed with messages like the following: ``` [981/1131] Building CXX object plugins/CMakeFiles/FlashLightPlugin.dir/FlashLightPlugin.cc.o In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22, from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23, from /usr/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14, from /usr/include/boost/smart_ptr/detail/spinlock.hpp:42, from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25, from /usr/include/boost/smart_ptr/shared_ptr.hpp:29, from /usr/include/boost/shared_ptr.hpp:17, from /home/alex/code/gazebo/gazebo/common/CommonTypes.hh:24, from /home/alex/code/gazebo/gazebo/common/Plugin.hh:36, from /home/alex/code/gazebo/plugins/FlashLightPlugin.cc:24: /usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’ ``` Though it might make sense to follow the suggestion in the error message and *not* have these symbols in the global namespace, for now suppress this warning by defining ``BOOST_GLOBAL_PLACEHOLDERS`` so the build log is actually readable. Signed-off-by: Alex Dewar <alex.dewar@gmx.co.uk>
The CI appears to be failing because of #2867, so it's not related to my changes. |
what OS and version of boost are you using? |
We used to see these warnings in our CI, as reported in #2757. This was supposedly fixed for gazebo9 in #2809 and merged forward to gazebo11 in #2923. I don't see these warnings in our macOS CI, which is using a rather recent version of boost from homebrew. Can you provide details about how to reproduce these warnings? |
would it be better to change all our includes of |
I've opened an alternate pull request in #3156. @alexdewar can you confirm if that resolves the compiler warnings for you? |
the fix was implemented in #3156. thanks again for raising the issue and submitting a fix |
When building Gazebo, my build log is spammed with messages like the following:
Though it might make sense to follow the suggestion in the error message and not have these symbols in the global namespace, for now suppress this warning by defining
BOOST_GLOBAL_PLACEHOLDERS
so the build log is actually readable.