[Boost-bugs] [Boost C++ Libraries] #2427: message_queue uses deprecated function in VS 8.0

Subject: [Boost-bugs] [Boost C++ Libraries] #2427: message_queue uses deprecated function in VS 8.0
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-10-21 16:44:14


#2427: message_queue uses deprecated function in VS 8.0
------------------------------------------+---------------------------------
 Reporter: Tom Kent <teeks99_at_[hidden]> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.36.0 | Severity: Problem
 Keywords: |
------------------------------------------+---------------------------------
 There is a usage of a deprecated function in Visual Studio 8.0 (2005) when
 using the message_queue in the interprocess library. However, this ONLY
 manifests itself when there is a #include <string> BEFORE the #include
 <boost/interprocess/ipc/message_queue.hpp>. If the string include is
 after the message_queue include, everything compiles fine.

 For example:

 {{{
 #include <string>
 #include <boost/interprocess/ipc/message_queue.hpp>
 #include <iostream>

 int main(int argc, char* argv[])
 {
    boost::interprocess::message_queue* rcv;
    std::string exampleString = "Hi";

    std::cout << exampleString << &rcv << std::endl;
    return 0;
 }

 }}}
 returns the warning

 {{{
 1>BoostMessageQueueTest.cpp
 1>c:\program files\microsoft visual studio 8\vc\include\xutility(2404) :
 warning C4996: 'std::_Copy_backward_opt'
 was declared deprecated
 1> c:\program files\microsoft visual studio
 8\vc\include\xutility(2391) : see declaration of
 'std::_Copy_backward_opt'
 1> Message: 'You have used a std:: construct that is not safe. See
 documentation on how to use the Safe
 Standard C++ Library'
 1> e:\boost
 building\boost_1_36_0\boost\interprocess\ipc\message_queue.hpp(270) : see
 reference to
 function template instantiation '_BidIt2
  std::copy_backward<boost::interprocess::detail::mq_hdr_t::
 msg_hdr_ptr_t*,boost::interprocess::detail::mq_hdr_t::msg_hdr_ptr_t*>(_BidIt1,_BidIt1,_BidIt2)'
 being compiled
 1> with
 1> [
 1> _BidIt2=boost::interprocess::detail::mq_hdr_t::msg_hdr_ptr_t
 *,
 1> _BidIt1=boost::interprocess::detail::mq_hdr_t::msg_hdr_ptr_t
 *
 1> ]
 }}}
 however if I do:

 {{{
 #include <boost/interprocess/ipc/message_queue.hpp>
 #include <string>
 #include <iostream>

 int main(int argc, char* argv[])
 {
    boost::interprocess::message_queue* rcv;
    std::string exampleString = "Hi";

    std::cout << exampleString << &rcv << std::endl;
    return 0;
 }

 }}}
 then everything builds without any warnings.

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2427>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC