id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 5545,ptr_container: unused parameter warnings if exceptions and asserts disabled,timb@…,Thorsten Ottosen,"With exceptions and asserts both disabled, `ptr_container_detail::reversible_ptr_container<>::enforce_null_policy()` generates unused-parameter warnings. Both its parameters are used only within an invocation of `BOOST_PTR_CONTAINER_THROW_EXCEPTION()`; with exceptions disabled, that expands to a `BOOST_ASSERT()`; with asserts disabled, that in turn becomes just `(void)0` (or equivalent). One way to fix this would be to make `BOOST_PTR_CONTAINER_THROW_EXCEPTION` expand to `BOOST_VERIFY` instead of `BOOST_ASSERT`, so that the parameters are still evaluated even when exceptions and asserts are disabled. This should make no difference when exceptions are enabled, or when exceptions are disabled but asserts are enabled. Minimal example: {{{ $ cat test.cpp #include void foo(int *p) { boost::ptr_vector().push_back(p); } $ g++ -W -Wall -fno-exceptions -Iboost -DNDEBUG -c test.cpp In file included from boost/boost/ptr_container/ptr_sequence_adapter.hpp:20, from boost/boost/ptr_container/ptr_vector.hpp:20, from test.cpp:1: boost/boost/ptr_container/detail/reversible_ptr_container.hpp: In instantiation of 'static void boost::ptr_container_detail::reversible_ptr_container::enforce_null_policy(const typename Config::value_type*, const char*) [with Config = boost::ptr_container_detail::sequence_config > >, CloneAllocator = boost::heap_clone_allocator]': boost/boost/ptr_container/ptr_sequence_adapter.hpp:246: instantiated from 'void boost::ptr_sequence_adapter::push_back(typename boost::ptr_container_detail::reversible_ptr_container, CloneAllocator>::value_type) [with T = int, VoidPtrSeq = std::vector >, CloneAllocator = boost::heap_clone_allocator]' test.cpp:5: instantiated from here boost/boost/ptr_container/detail/reversible_ptr_container.hpp:260: warning: unused parameter 'x' boost/boost/ptr_container/detail/reversible_ptr_container.hpp:260: warning: unused parameter 'msg' }}} (g++ will not emit the warnings if the boost headers are found in the system include directories.)",Bugs,new,To Be Determined,ptr_container,Boost 1.39.0,Problem,,,