[challenge] detect MSVC8 SP1 with the preprocessor

Hello, as you probably know there's a Service Pack for Visual Studio 2005 which fixes a significant number of bugs. Unfortunately _MSC_VER is 1400 for MSVC8 with and without Service Pack, so there is no straightforward way for a library to find out whether SP1 fixes are available or not. The release notes of that Service Pack mention a fixed bug in the preprocessor messing up line counting in certain situations, so it seems there could be a way to implement a detection mechanism in the preprocessor on top of it... Solutions anyone? Regards, Tobias

Tobias Schwinger:
Hello,
as you probably know there's a Service Pack for Visual Studio 2005 which fixes a significant number of bugs.
Unfortunately _MSC_VER is 1400 for MSVC8 with and without Service Pack, so there is no straightforward way for a library to find out whether SP1 fixes are available or not.
What does _MSC_FULL_VER say?

Peter Dimov wrote:
Tobias Schwinger:
Hello,
as you probably know there's a Service Pack for Visual Studio 2005 which fixes a significant number of bugs.
Unfortunately _MSC_VER is 1400 for MSVC8 with and without Service Pack, so there is no straightforward way for a library to find out whether SP1 fixes are available or not.
What does _MSC_FULL_VER say?
I probably should have mentioned it's 140050727 for both versions ;-/. Regards, Tobias

Tobias Schwinger wrote:
Peter Dimov wrote:
Tobias Schwinger:
Hello,
as you probably know there's a Service Pack for Visual Studio 2005 which fixes a significant number of bugs.
Unfortunately _MSC_VER is 1400 for MSVC8 with and without Service Pack, so there is no straightforward way for a library to find out whether SP1 fixes are available or not. What does _MSC_FULL_VER say?
I probably should have mentioned it's 140050727 for both versions ;-/.
Can you use registry info somehow? http://blogs.msdn.com/heaths/archive/2006/12/17/detecting-visual-studio-2005...

eg wrote:
Tobias Schwinger wrote:
Peter Dimov wrote:
Tobias Schwinger:
Hello,
as you probably know there's a Service Pack for Visual Studio 2005 which fixes a significant number of bugs.
Unfortunately _MSC_VER is 1400 for MSVC8 with and without Service Pack, so there is no straightforward way for a library to find out whether SP1 fixes are available or not. What does _MSC_FULL_VER say? I probably should have mentioned it's 140050727 for both versions ;-/.
Can you use registry info somehow?
http://blogs.msdn.com/heaths/archive/2006/12/17/detecting-visual-studio-2005...
Leaves us with the "reduced" problem of querying the Windows registry with the preprocessor :-). Kidding aside, I think that checking for that PP bug (mentioned in the OP) is the only reasonable option, there is. Unfortunately I don't know how to trigger it (still hoping for someone who has met it personally). Regards, Tobias

on Wed Sep 12 2007, Tobias Schwinger <tschwinger-AT-isonews2.com> wrote:
Hello,
as you probably know there's a Service Pack for Visual Studio 2005 which fixes a significant number of bugs.
Unfortunately _MSC_VER is 1400 for MSVC8 with and without Service Pack, so there is no straightforward way for a library to find out whether SP1 fixes are available or not.
See _MSC_FULL_VER :) -- Dave Abrahams Boost Consulting http://www.boost-consulting.com The Astoria Seminar ==> http://www.astoriaseminar.com

Tobias Schwinger wrote:
Solutions anyone?
From the Boost.Config refactor proposal... <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostConfig> // Microsoft Visual C++ #if !defined (_MSC_FULL_VER) # define BOOST_CXX_MSVC_BUILD 0 #else // how many digits does the build number have? // # if _MSC_FULL_VER / 10000 == _MSC_VER # define BOOST_CXX_MSVC_BUILD (_MSC_FULL_VER % 10000) // four digits # elif _MSC_FULL_VER / 100000 == _MSC_VER # define BOOST_CXX_MSVC_BUILD (_MSC_FULL_VER % 100000) // five digits # else # error "Cannot determine build number from _MSC_FULL_VER" # endif #endif #define BOOST_CXX_MSVC BOOST_VERSION_NUMBER( \ _MSC_VER/100-6, \ _MSC_VER%100, \ BOOST_CXX_MSVC_BUILD) One should be able to use the _MSC_FULL_VER value. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

Rene Rivera wrote:
Tobias Schwinger wrote:
Solutions anyone?
From the Boost.Config refactor proposal... <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostConfig>
// Microsoft Visual C++ #if !defined (_MSC_FULL_VER) # define BOOST_CXX_MSVC_BUILD 0 #else // how many digits does the build number have? // # if _MSC_FULL_VER / 10000 == _MSC_VER # define BOOST_CXX_MSVC_BUILD (_MSC_FULL_VER % 10000) // four digits # elif _MSC_FULL_VER / 100000 == _MSC_VER # define BOOST_CXX_MSVC_BUILD (_MSC_FULL_VER % 100000) // five digits # else # error "Cannot determine build number from _MSC_FULL_VER" # endif #endif #define BOOST_CXX_MSVC BOOST_VERSION_NUMBER( \ _MSC_VER/100-6, \ _MSC_VER%100, \ BOOST_CXX_MSVC_BUILD)
One should be able to use the _MSC_FULL_VER value.
There is also _MSC_BUILD starting in VS 2008 that can be used to identify the minor build number. http://tinyurl.com/ys99kr - Michael Marcin

On Thursday 13 September 2007 00:51:08 Tobias Schwinger wrote:
as you probably know there's a Service Pack for Visual Studio 2005 which fixes a significant number of bugs.
Where? I guess most of these are not in the compiler, right?
Unfortunately _MSC_VER is 1400 for MSVC8 with and without Service Pack, so there is no straightforward way for a library to find out whether SP1 fixes are available or not.
Almost true: _MSC_VER is 1401 for the MIPS cross-compiler used for MS Windows CE.
The release notes of that Service Pack mention a fixed bug in the preprocessor messing up line counting in certain situations, so it seems there could be a way to implement a detection mechanism in the preprocessor on top of it...
Hmmm, that would contradict the version being _exactly_ the same (even the full one), do you have a link handy?
Solutions anyone?
I might be able to find an installation without service pack in order to diff the included headers, but not before monday. If the fixes were there, it should be possible to detect that then. Uli

Ulrich Eckhardt wrote:
On Thursday 13 September 2007 00:51:08 Tobias Schwinger wrote:
as you probably know there's a Service Pack for Visual Studio 2005 which fixes a significant number of bugs.
Where? I guess most of these are not in the compiler, right?
No, there are quite a few compiler fixes. See: http://tinyurl.com/ypk367 _MSC_VER and _MSC_FULL_VER are the same for the updated C++ compiler. The build ID (where there's no macro to query it until VC2008) is different (the one needs a workaround to compile my code, the other one doesn't).
Solutions anyone?
I might be able to find an installation without service pack in order to diff the included headers, but not before monday. If the fixes were there, it should be possible to detect that then.
I was thinking about checking for this bug http://tinyurl.com/2xyvxs (seems the attachments are not disclosed by the bug tracker). And I had hoped to find someone here who knows exactly how to do it. Checking for changes in the standard library might be another option, although I didn't find a fix that's looking very promising. There's a non-SP1 MSVC8 compiler included in the Windows SDK, so there should be both versions on most Windows developer boxes... Regards, Tobias
participants (7)
-
David Abrahams
-
eg
-
Michael Marcin
-
Peter Dimov
-
Rene Rivera
-
Tobias Schwinger
-
Ulrich Eckhardt