Ticket #7255 (closed Bugs: fixed)
lexical_cast is broken on MSVC .NET 2003
|Reported by:||Manfred <kuhnkies@…>||Owned by:||apolukhin|
|Keywords:||MS Secure CRT sprintf_s||Cc:|
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
- Summary changed from lexical_cast ist broken on MSVC .NET 2003 to lexical_cast is broken on MSVC .NET 2003
- Keywords sprintf_s added
- Status changed from new to assigned
- Milestone changed from To Be Determined to Boost 1.52.0