From edde5f442e0d982348ceb71e215efb2afbad6823 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 22 Oct 2013 09:07:02 +0000 Subject: [PATCH] Another attempt to suppress MSVC warnings (refs #9271) [SVN r86388] --- include/boost/detail/basic_pointerbuf.hpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/include/boost/detail/basic_pointerbuf.hpp b/include/boost/detail/basic_pointerbuf.hpp index f2360ae..1d8cf37 100644 --- a/include/boost/detail/basic_pointerbuf.hpp +++ b/include/boost/detail/basic_pointerbuf.hpp @@ -23,12 +23,6 @@ namespace boost { namespace detail { -#ifdef BOOST_MSVC -#pragma warning(push) -// VC mistakenly assumes that `setbuf` and other functions are not referenced. -#pragma warning(disable: 4505) //Unreferenced local function has been removed -#endif - // // class basic_pointerbuf: // acts as a stream buffer which wraps around a pair of pointers: @@ -57,9 +51,13 @@ public: #endif protected: - base_type* setbuf(char_type* s, streamsize n); - typename this_type::pos_type seekpos(pos_type sp, ::std::ios_base::openmode which); - typename this_type::pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which); + // VC mistakenly assumes that `setbuf` and other functions are not referenced. + // Marking those functions with `inline` suppresses the warnings. + // There must be no harm from marking virtual functions as inline: inline virtual + // call can be inlined ONLY when the compiler knows the "exact class". + inline base_type* setbuf(char_type* s, streamsize n); + inline typename this_type::pos_type seekpos(pos_type sp, ::std::ios_base::openmode which); + inline typename this_type::pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which); private: basic_pointerbuf& operator=(const basic_pointerbuf&); @@ -135,10 +133,6 @@ basic_pointerbuf::seekpos(pos_type sp, ::std::ios_base::openmode return pos_type(off_type(-1)); } -#ifdef BOOST_MSVC -#pragma warning(pop) -#endif - }} // namespace boost::detail #endif // BOOST_DETAIL_BASIC_POINTERBUF_HPP