[Boost-bugs] [Boost C++ Libraries] #7255: lexical_cast ist broken on MSVC .NET 2003

Subject: [Boost-bugs] [Boost C++ Libraries] #7255: lexical_cast ist broken on MSVC .NET 2003
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-08-21 12:01:03


#7255: lexical_cast ist broken on MSVC .NET 2003
-------------------------------------------+--------------------------------
 Reporter: Manfred <kuhnkies@…> | Owner: apolukhin
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: lexical_cast
  Version: Boost 1.51.0 | Severity: Showstopper
 Keywords: MS Secure CRT |
-------------------------------------------+--------------------------------
 I could not find any hint in the release note that boost 1.51 does no
 longer support Visual Studio .NET 2003. Hence, I consider the following a
 (minor) bug. However it causes our project to fail the build on this
 platform, first time for a reason that I don't consider as "no way out".

 author's assumed intention:
 In boost 1.51 in file boost/lexical_cast.hpp in line 1353 and 1366, 1380
 the Microsoft secure crt version sprintf_s of sprintf is called. This call
 is compiled under the condition that _MSC_VER is defined (with any
 value!).

 presumably unconsidered, severe problem:
 Please note, that the Microsoft secure crt was introduced with Visual
 Studio 2005. Visual Studio .NET 2003 does already have _MSC_VER defined.
 So, the conditional preprocessor instruction "#if(defined _MSC_VER)" imho
 is ill placed here.

 suggestion:
 I'd like to suggest to consider the numerical values of _MSC_VER here. If
 _MSC_VER is smaller than 1400 then Visual Studio version is before 8.0 or
 VS 2005 respectively. Hence I'd appreciate boost code to use a little more
 complex preprocessor conditional than befor, namely something like

 #if _MSC_VER >= 1400
   do it the MS Secure CRT Way
 #else
   ISO C++
 #endif

 best regards
   Manfred

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