Opened 12 years ago
#4633 new Bugs
boost/ptr_container/ptr_sequence_adapter.hpp:671: unreferenced parameters 'first', 'last' when compiled with no assertions
Reported by: | anonymous | Owned by: | Thorsten Ottosen |
---|---|---|---|
Milestone: | To Be Determined | Component: | ptr_container |
Version: | Boost 1.44.0 | Severity: | Cosmetic |
Keywords: | Cc: |
Description
As of r65343 file boost/ptr_container/ptr_sequence_adapter.hpp at function range_check_impl (std::random_access_iterator_tag version), the parameters 'first' and 'last' are referenced only inside a BOOST_ASSERT call. When assertions are compiled out, these parameters become unreferenced. This causes warning C4100 from Microsoft Visual Studio 9. It would be nice to mark the parameters as intentionally unused so that this warning is not generated. The simplest way to do this is to add "(void)first; (void)last;" in the function body. Other more elaborate mechanisms exist, but as far as I know, casting to void is a simple and portable way to prevent the warning without disrupting the debug code's access to these variables.