Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86388 - trunk/boost/detail
From: antoshkka_at_[hidden]
Date: 2013-10-22 05:07:02


Author: apolukhin
Date: 2013-10-22 05:07:02 EDT (Tue, 22 Oct 2013)
New Revision: 86388
URL: http://svn.boost.org/trac/boost/changeset/86388

Log:
Another attempt to suppress MSVC warnings (refs #9271)

Text files modified:
   trunk/boost/detail/basic_pointerbuf.hpp | 20 +++++++-------------
   1 files changed, 7 insertions(+), 13 deletions(-)

Modified: trunk/boost/detail/basic_pointerbuf.hpp
==============================================================================
--- trunk/boost/detail/basic_pointerbuf.hpp Mon Oct 21 20:10:55 2013 (r86387)
+++ trunk/boost/detail/basic_pointerbuf.hpp 2013-10-22 05:07:02 EDT (Tue, 22 Oct 2013) (r86388)
@@ -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 @@
 #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 @@
    return pos_type(off_type(-1));
 }
 
-#ifdef BOOST_MSVC
-#pragma warning(pop)
-#endif
-
 }} // namespace boost::detail
 
 #endif // BOOST_DETAIL_BASIC_POINTERBUF_HPP


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk