[Boost-bugs] [Boost C++ Libraries] #5036: Boost.Test VC memory leak report should direct to stderr

Subject: [Boost-bugs] [Boost C++ Libraries] #5036: Boost.Test VC memory leak report should direct to stderr
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-03 16:04:12


#5036: Boost.Test VC memory leak report should direct to stderr
------------------------------+---------------------------------------------
 Reporter: anonymous | Owner: rogeeff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.45.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 Boost.Test includes a memory leak detection feature (uses the ones MSV
 provided). Unfortunately it redirects the output to stdout, not
 conventional stderr.

 We are currently creating XML-based test reports. If the memory leak
 happended, the XML becomes ill-formed. For better interoperability, the
 debug output should go to stderr.

 I traced the place where the called in placed (in
 boost/test/impl/debug.ipp)


 {{{
 #ifdef BOOST_MS_CRT_BASED_DEBUG
     int flags = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );

     if( !on_off )
         flags &= ~_CRTDBG_LEAK_CHECK_DF;
     else {
         flags |= _CRTDBG_LEAK_CHECK_DF;
         _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
         _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
     }

     _CrtSetDbgFlag ( flags );
 #endif // BOOST_MS_CRT_BASED_DEBUG
 }}}

 The call _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT); should be
 changed to

  _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5036>
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:50:05 UTC